gsoap/gs99-overrun.diff

24 lines
930 B
Diff

From: Jan Engelhardt <jengelh@inai.de>
Date: 2020-04-08 11:47:38.536817437 +0200
References: https://sourceforge.net/p/gsoap2/bugs/1277/
Fix a buffer overread introduced in gsoap 2.8.99.
---
gsoap/stdsoap2.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: gsoap-2.8.100/gsoap/stdsoap2.cpp
===================================================================
--- gsoap-2.8.100.orig/gsoap/stdsoap2.cpp
+++ gsoap-2.8.100/gsoap/stdsoap2.cpp
@@ -7075,7 +7075,7 @@ soap_accept(struct soap *soap)
if (getaddrinfo(soap->host, NULL, &hints, &res) == 0 && res)
{
struct sockaddr_storage result;
- (void)soap_memcpy(&result, sizeof(result), res->ai_addr, sizeof(result));
+ (void)soap_memcpy(&result, sizeof(result), res->ai_addr, res->ai_addrlen < sizeof(result) ? res->ai_addrlen : sizeof(result));
freeaddrinfo(res);
if (result.ss_family == AF_INET6)
{