Kaydet (Commit) cdd6aca1 authored tarafından jan iversen's avatar jan iversen Kaydeden (comit) Stephan Bergmann

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/19751Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 84eeebd7
...@@ -766,6 +766,7 @@ namespace osl_StreamPipe ...@@ -766,6 +766,7 @@ namespace osl_StreamPipe
printf("read failed! \n"); printf("read failed! \n");
return; return;
} }
buf[sizeof(buf)-1] = '\0';
printf("buffer is %s \n", buf); printf("buffer is %s \n", buf);
printf("send\n"); printf("send\n");
nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 ); nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 );
...@@ -829,6 +830,7 @@ namespace osl_StreamPipe ...@@ -829,6 +830,7 @@ namespace osl_StreamPipe
printf("server receive failed! \n"); printf("server receive failed! \n");
return; return;
} }
buf[sizeof(buf)-1] = '\0';
printf("received message is: %s\n", buf ); printf("received message is: %s\n", buf );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment