aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-31 11:34:59 +0100
committerMax <msuraev@sysmocom.de>2018-01-31 11:34:59 +0100
commit99eb07e232a2735f0aaae9ec0083467fad0e2d6c (patch)
tree2b5f68936c5e1371dfbf1da7733bddc16737216f /tests
parent89be118a3ba7ed983d9174130883534b66052b1a (diff)
tests: null-terminate buffer
Initialize temporary buffer with 0 to make sure that it's null-terminated. Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Fixes: CID149362
Diffstat (limited to 'tests')
-rw-r--r--tests/CommonLibs/SocketsTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index c4e31d8..eb92e25 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -47,7 +47,7 @@ void *testReaderIP(void *param)
readSocket->nonblocking();
int rc = 0;
while (rc<gNumToSend) {
- char buf[MAX_UDP_LENGTH];
+ char buf[MAX_UDP_LENGTH] = { 0 };
int count = readSocket->read(buf, MAX_UDP_LENGTH);
if (count>0) {
CERR("read: " << buf);