[esnet/iperf] 356f01: Initialize cookie buffer

1 view
Skip to first unread message

Bruce A. Mah

unread,
May 24, 2024, 2:46:15 PMMay 24
to iper...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/esnet/iperf
Commit: 356f01f91485937173e5557c61d5a41b845a1943
https://github.com/esnet/iperf/commit/356f01f91485937173e5557c61d5a41b845a1943
Author: Matthew Cather <14895427...@users.noreply.github.com>
Date: 2024-05-10 (Fri, 10 May 2024)

Changed paths:
M src/iperf_tcp.c

Log Message:
-----------
Initialize cookie buffer

`Nread` reads up *to* N bytes from the socket. Since we only check that we read more than 0 bytes, it's possible for the cookie buffer only be partially initialized (and may not contain a valid null terminated string). Initializing the buffer to 0 fixes this.

Also swap `strcmp` with `strncmp` since we know know exactly how long a cookie should be. This will help prevent any buffer overflows if the length of the cookie ever changes for some reason.


Commit: 69a1eb3a3b5937284300d775d524842ae7a77cca
https://github.com/esnet/iperf/commit/69a1eb3a3b5937284300d775d524842ae7a77cca
Author: Bruce A. Mah <bm...@es.net>
Date: 2024-05-24 (Fri, 24 May 2024)

Changed paths:
M src/iperf_tcp.c

Log Message:
-----------
Merge pull request #1698 from MattCatz/patch-1

Initialize cookie buffer


Compare: https://github.com/esnet/iperf/compare/6254d115ad3e...69a1eb3a3b59

To unsubscribe from these emails, change your notification settings at https://github.com/esnet/iperf/settings/notifications
Reply all
Reply to author
Forward
0 new messages