From f5e1cf8790db5db655d08b5e93e78dbfd6df29d6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Oct 2018 12:14:55 +0200 Subject: [PATCH] SocketsTest.testReaderIP(): Zero terminate received buffer Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba --- tests/CommonLibs/SocketsTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index eb92e253..e4eef545 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -47,9 +47,10 @@ void *testReaderIP(void *param) readSocket->nonblocking(); int rc = 0; while (rcread(buf, MAX_UDP_LENGTH); if (count>0) { + buf[count] = 0; CERR("read: " << buf); rc++; } else {