Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11405


Change subject: SocketsTest.testReaderIP(): Zero terminate received buffer
......................................................................

SocketsTest.testReaderIP(): Zero terminate received buffer

Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
---
M tests/CommonLibs/SocketsTest.cpp
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/05/11405/1

diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index eb92e25..e4eef54 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -47,9 +47,10 @@
        readSocket->nonblocking();
        int rc = 0;
        while (rc<gNumToSend) {
-               char buf[MAX_UDP_LENGTH] = { 0 };
+               char buf[MAX_UDP_LENGTH+1] = { 0 };
                int count = readSocket->read(buf, MAX_UDP_LENGTH);
                if (count>0) {
+                       buf[count] = 0;
                        CERR("read: " << buf);
                        rc++;
                } else {

--
To view, visit https://gerrit.osmocom.org/11405
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
Gerrit-Change-Number: 11405
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to