blob: 30f1432cd36f6fceda02d49e7c6339438d1e92a4 [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From f0a8c69971b30ea7ca255bb885fdd1179fa5d298 Mon Sep 17 00:00:00 2001
2From: Nicola Lunghi <nick83ola@gmail.com>
3Date: Thu, 23 May 2019 07:55:25 +0100
4Subject: [PATCH] gweb: fix segfault with musl v1.1.21
5
6In musl > v1.1.21 freeaddrinfo() implementation changed and
7was causing a segmentation fault on recent Yocto using musl.
8
9See this commit:
10
11 https://git.musl-libc.org/cgit/musl/commit/src/network/freeaddrinfo.c?id=d1395c43c019aec6b855cf3c656bf47c8a719e7f
12
13Upstream-Status: Submitted
14---
15 gweb/gweb.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/gweb/gweb.c b/gweb/gweb.c
19index 393afe0a..12fcb1d8 100644
20--- a/gweb/gweb.c
21+++ b/gweb/gweb.c
22@@ -1274,7 +1274,8 @@ static bool is_ip_address(const char *host)
23 addr = NULL;
24
25 result = getaddrinfo(host, NULL, &hints, &addr);
26- freeaddrinfo(addr);
27+ if(!result)
28+ freeaddrinfo(addr);
29
30 return result == 0;
31 }
32--
332.19.1
34