httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r514954 - /httpd/httpd/trunk/support/logresolve.c
Date Tue, 06 Mar 2007 02:00:19 GMT
Author: colm
Date: Mon Mar  5 18:00:18 2007
New Revision: 514954

URL: http://svn.apache.org/viewvc?view=rev&rev=514954
Log:
Fix near-identical potential NULL pointer dereferences, as found by
Jorton and corrected in r514915

Modified:
    httpd/httpd/trunk/support/logresolve.c

Modified: httpd/httpd/trunk/support/logresolve.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/logresolve.c?view=diff&rev=514954&r1=514953&r2=514954
==============================================================================
--- httpd/httpd/trunk/support/logresolve.c (original)
+++ httpd/httpd/trunk/support/logresolve.c Mon Mar  5 18:00:18 2007
@@ -259,12 +259,12 @@
         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 @@
             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;



Mime
View raw message