From adbe9370115495f9533ad6dae9b37e512424532e Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 6 Mar 2007 02:00:18 +0000 Subject: [PATCH] Fix near-identical potential NULL pointer dereferences, as found by Jorton and corrected in r514915 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@514954 13f79535-47bb-0310-9956-ffa450edef68 --- support/logresolve.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/support/logresolve.c b/support/logresolve.c index f0310e973b..ff34142354 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -259,12 +259,12 @@ int main(int argc, const char * const argv[]) status = apr_getnameinfo(&hostname, ip, 0) != APR_SUCCESS; if (status || hostname == NULL) { /* Could not perform a reverse lookup */ - *space = ' '; + if (space) *space = ' '; apr_file_puts(line, outfile); noreverse++; /* Add to cache */ - *space = '\0'; + if (space) *space = '\0'; apr_hash_set(cache, line, APR_HASH_KEY_STRING, apr_pstrdup(pool, line)); continue; @@ -280,12 +280,12 @@ int main(int argc, const char * const argv[]) if (status == APR_SUCCESS || memcmp(ipdouble->ipaddr_ptr, ip->ipaddr_ptr, ip->ipaddr_len)) { /* Double-lookup failed */ - *space = ' '; + if (space) *space = ' '; apr_file_puts(line, outfile); doublefailed++; /* Add to cache */ - *space = '\0'; + if (space) *space = '\0'; apr_hash_set(cache, line, APR_HASH_KEY_STRING, apr_pstrdup(pool, line)); continue; -- 2.50.1