From: Colm MacCarthaigh Date: Tue, 6 Mar 2007 02:00:18 +0000 (+0000) Subject: Fix near-identical potential NULL pointer dereferences, as found by X-Git-Tag: 2.3.0~1894 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adbe9370115495f9533ad6dae9b37e512424532e;p=apache 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 --- 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;