mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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 <ai.neo.ae86@gmail.com>
This commit is contained in:
parent
50ffee7a85
commit
662133eeca
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue