]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
crash fix: never return const string as address
authorSami Kerola <kerolasa@iki.fi>
Sat, 3 Sep 2016 23:49:06 +0000 (00:49 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 4 Sep 2016 16:03:04 +0000 (17:03 +0100)
String that comes from #define can cause SIGSEGV.

asn.c

diff --git a/asn.c b/asn.c
index c6454cf445a39778c72c3efe309e95a1ec44f075..a19671fa95fa86a6ff27d62660281220bacc7f61 100644 (file)
--- a/asn.c
+++ b/asn.c
@@ -90,7 +90,7 @@ static char *ipinfo_lookup(const char *domain) {
     if((len = res_query(domain, C_IN, T_TXT, answer, PACKETSZ)) < 0) {
         if (iihash)
             DEB_syslog(LOG_INFO, "Malloc-txt: %s", UNKN);
-        return (iihash) ? xstrdup(UNKN) : UNKN;
+        return xstrdup(UNKN);
     }
 
     pt = answer + sizeof(HEADER);