summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-02-17 12:43:32 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-02-19 03:05:55 +0000
commit6c8f448cffb88cbd320f6c694a296d6762426b36 (patch)
tree6bb3f2d66355d01af4804181d988c11374b28e9f /desktop
parent6e6af9943ca72f0b2b27726b7051db2ddbf378dd (diff)
coverity#983483 String not null terminated
Change-Id: I4cefa485b52afcdb761bfea99dd2515a206812a8 Reviewed-on: https://gerrit.libreoffice.org/2199 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/officeipcthread.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index d26cf08bda63..8db7946e253e 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