From 1bd6dd3133a77ba3f1928ea4bd4710e8223f5ea5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 14 Feb 2018 13:20:01 +0000 Subject: [PATCH] Merge r1745863, r1745864 from trunk: Fix segfault with logresolve -c and IPv6 Due to a logic error, there could be a NULL pointer dereference. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823259 Fix comment typo Submitted by: sf Reviewed by: jailletc36, minfrin, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824239 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ------- support/logresolve.c | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/STATUS b/STATUS index b80dd089cd..9f6071e38f 100644 --- a/STATUS +++ b/STATUS @@ -119,13 +119,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) logresolve: Fix segfault with logresolve -c and IPv6 - Due to a logic error, there could be a NULL pointer dereference. - [Stefan Fritsch] - trunk patch: http://svn.apache.org/r1745863 - http://svn.apache.org/r1745864 - 2.4.x patch: trunk works - +1: jailletc36, minfrin, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/support/logresolve.c b/support/logresolve.c index 87df4e82e8..1cab753bc3 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -284,7 +284,7 @@ int main(int argc, const char * const argv[]) */ status = apr_sockaddr_info_get(&ipdouble, hostname, ip->family, 0, 0, pline); - if (status == APR_SUCCESS || + if (status != APR_SUCCESS || memcmp(ipdouble->ipaddr_ptr, ip->ipaddr_ptr, ip->ipaddr_len)) { /* Double-lookup failed */ *space = ' '; @@ -299,7 +299,7 @@ int main(int argc, const char * const argv[]) } } - /* Outout the resolved name */ + /* Output the resolved name */ apr_file_printf(outfile, "%s %s", hostname, space + 1); /* Store it in the cache */ -- 2.50.1