summaryrefslogtreecommitdiff
path: root/support/logresolve.c
diff options
context:
space:
mode:
authorColm MacCarthaigh <colm@apache.org>2007-03-06 02:00:18 +0000
committerColm MacCarthaigh <colm@apache.org>2007-03-06 02:00:18 +0000
commitadbe9370115495f9533ad6dae9b37e512424532e (patch)
tree98465568eb707828709227bffb54f276c685b4d8 /support/logresolve.c
parent9c70c93e8ac16b2b42bc3a94cfa05b58ad581c11 (diff)
downloadhttpd-adbe9370115495f9533ad6dae9b37e512424532e.tar.gz
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
Diffstat (limited to 'support/logresolve.c')
-rw-r--r--support/logresolve.c8
1 files 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;