Harald Welte has submitted this change and it was merged. (
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(-)
Approvals:
Jenkins Builder: Verified
Harald Welte: Looks good to me, approved
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: merged
Gerrit-Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
Gerrit-Change-Number: 11405
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)