From 3be1612e19bd1cd6ba4bc9c28ad16567070b9b1c Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Mon, 18 Nov 2024 14:17:10 +0900 Subject: [PATCH] Fix incorrect initialization of addrlen in socket.accept --- src/modules/module_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module_socket.c b/src/modules/module_socket.c index 06b2f1d9..b39360ac 100644 --- a/src/modules/module_socket.c +++ b/src/modules/module_socket.c @@ -318,7 +318,7 @@ KRK_Method(socket,listen) { KRK_Method(socket,accept) { struct sockaddr_storage addr; - socklen_t addrlen; + socklen_t addrlen = sizeof(struct sockaddr_storage); int result = accept(self->sockfd, (struct sockaddr*)&addr, &addrlen);