desktop/source/app/officeipcthread.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 6c8f448cffb88cbd320f6c694a296d6762426b36 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Sun Feb 17 12:43:32 2013 -0600 coverity#983483 String not null terminated Change-Id: I4cefa485b52afcdb761bfea99dd2515a206812a8 Reviewed-on: https://gerrit.libreoffice.org/2199 Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com> Tested-by: Norbert Thiebaud <nthieb...@gmail.com> diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index d26cf08..8db7946 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -502,12 +502,18 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() int nBytes = 0; int nBufSz = sc_nCSASeqLength + 1; // read byte per byte + pReceiveBuffer[0] = 0; while ((nResult=aStreamPipe.recv( pReceiveBuffer+nBytes, nBufSz-nBytes))>0) { nBytes += nResult; if (pReceiveBuffer[nBytes-1]=='\0') { break; } } + /* make sure the buffer is \0 terminated */ + if (nBytes > 0) + { + pReceiveBuffer[nBytes-1] = 0; + } if (rtl::OString(sc_aSendArgumentsSequence).equals(pReceiveBuffer)) { // Pipe connected to first office _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits