void-packages/srcpkgs/connman/files/musl/freeaddrinfo.patch

18 lines
386 B
Diff
Raw Normal View History

musl > 1.1.21 segfaults on null pointers to freeaddrinfo
diff --git a/gweb/gweb.c b/gweb/gweb.c
index 393afe0a..12fcb1d8 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -1274,7 +1274,8 @@ static bool is_ip_address(const char *host)
addr = NULL;
result = getaddrinfo(host, NULL, &hints, &addr);
- freeaddrinfo(addr);
+ if(!result)
+ freeaddrinfo(addr);
return result == 0;
}