Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/iperf_server_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ iperf_accept(struct iperf_test *test)
i_errno = IERECVCOOKIE;
goto error_handling;
}
/*
* The cookie is later handled as a NUL-terminated string (printed
* and copied into JSON output), but a peer can send COOKIE_SIZE
* non-NUL bytes, so make sure it is terminated before it is used.
*/
test->cookie[COOKIE_SIZE - 1] = '\0';
FD_SET(test->ctrl_sck, &test->read_set);
if (test->ctrl_sck > test->max_fd) test->max_fd = test->ctrl_sck;

Expand Down
Loading