From cdd6aca142495e433d70f85fee2851b60bc0d299 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Tue, 3 Nov 2015 08:49:45 +0100 Subject: Solved CID 1338058 and CID 1338057 terminated buf correctly before calling printf. This should be done automatically but coverity does not see it. Change-Id: I0bcf8486b27dbfa9f7c49b338bbf483029b523cb Reviewed-on: https://gerrit.libreoffice.org/19751 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- sal/qa/osl/pipe/osl_Pipe.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sal') diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index 9f1ae6e3db4b..9f04b503014f 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -766,6 +766,7 @@ namespace osl_StreamPipe printf("read failed! \n"); return; } + buf[sizeof(buf)-1] = '\0'; printf("buffer is %s \n", buf); printf("send\n"); nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 ); @@ -829,6 +830,7 @@ namespace osl_StreamPipe printf("server receive failed! \n"); return; } + buf[sizeof(buf)-1] = '\0'; printf("received message is: %s\n", buf ); } } -- cgit