On 11/12/19 10:49 AM, Ondrej Mosnacek wrote:
The 'addrlen' argument of accept(2) must point to a variable containing
the size of the structure pointed to by 'addr'. In some cases it was
being left unitialized. Fix this.
Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
Thanks, applied.
---
tests/sctp/sctp_asconf_params_server.c | 1 +
tests/sctp/sctp_set_peer_addr.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/sctp/sctp_asconf_params_server.c b/tests/sctp/sctp_asconf_params_server.c
index 3333ba0..ff7473b 100644
--- a/tests/sctp/sctp_asconf_params_server.c
+++ b/tests/sctp/sctp_asconf_params_server.c
@@ -112,6 +112,7 @@ int main(int argc, char **argv)
fclose(f);
}
+ sinlen = sizeof(sin);
new_sock = accept(srv_sock, (struct sockaddr *)&sin, &sinlen);
if (new_sock < 0) {
perror("accept");
diff --git a/tests/sctp/sctp_set_peer_addr.c b/tests/sctp/sctp_set_peer_addr.c
index 61a3a44..c35b518 100644
--- a/tests/sctp/sctp_set_peer_addr.c
+++ b/tests/sctp/sctp_set_peer_addr.c
@@ -277,6 +277,7 @@ int main(int argc, char **argv)
printf("Client peer address count: %d\n", peer_count);
/* Client and server now set so accept new socket on server side. */
+ sinlen = sizeof(sin);
new_sock = accept(srv_sock, (struct sockaddr *)&sin, &sinlen);
if (new_sock < 0) {
perror("accept");