From 662133eeca511f00d4051d79070192e8bb4f7a3c Mon Sep 17 00:00:00 2001 From: Old-Ding Date: Mon, 6 Jul 2026 04:32:20 +0800 Subject: [PATCH] testing: nettest: Fix TCP server terminator bounds The TCP nettest server receives up to TEST_BUFFER_SIZE bytes and then appends a NUL terminator before checking for the exit command. A full-size receive can therefore write one byte past the receive buffer. Reserve one extra byte for the terminator while keeping the recv() limit and echo length capped at TEST_BUFFER_SIZE. Signed-off-by: Old-Ding --- testing/nettest/utils/nettest_tcpserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/nettest/utils/nettest_tcpserver.c b/testing/nettest/utils/nettest_tcpserver.c index a11f41d92..85c4a458a 100644 --- a/testing/nettest/utils/nettest_tcpserver.c +++ b/testing/nettest/utils/nettest_tcpserver.c @@ -47,7 +47,7 @@ struct nettest_listener_s { fd_set master; fd_set working; - char buffer[TEST_BUFFER_SIZE]; + char buffer[TEST_BUFFER_SIZE + 1]; int listensdv4; int listensdv6; int mxsd;