httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r982011 - /httpd/httpd/trunk/modules/ldap/util_ldap.c
Date Tue, 03 Aug 2010 19:36:03 GMT
Author: sf
Date: Tue Aug  3 19:36:03 2010
New Revision: 982011

URL: http://svn.apache.org/viewvc?rev=982011&view=rev
Log:
set free()d pointers to NULL to avoid potential use-after-free bugs

Modified:
    httpd/httpd/trunk/modules/ldap/util_ldap.c

Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=982011&r1=982010&r2=982011&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Tue Aug  3 19:36:03 2010
@@ -206,9 +206,11 @@ static apr_status_t uldap_connection_cle
         /* free the username and password */
         if (ldc->bindpw) {
             free((void*)ldc->bindpw);
+            ldc->bindpw = NULL;
         }
         if (ldc->binddn) {
             free((void*)ldc->binddn);
+            ldc->binddn = NULL;
         }
         /* ldc->reason is allocated from r->pool */
         if (ldc->reason) {
@@ -217,7 +219,7 @@ static apr_status_t uldap_connection_cle
         /* unlock this entry */
         uldap_connection_close(ldc);
 
-     }
+    }
 
     return APR_SUCCESS;
 }



Mime
View raw message