]> granicus.if.org Git - php/commitdiff
Fix Bug #25525 ldap_explode_dn crashes when passed invalid params.
authorSara Golemon <pollita@php.net>
Sat, 13 Sep 2003 17:31:07 +0000 (17:31 +0000)
committerSara Golemon <pollita@php.net>
Sat, 13 Sep 2003 17:31:07 +0000 (17:31 +0000)
ext/ldap/ldap.c

index 02aa7a162e03c68004f521c10909ec0e7f527b07..122b17285d6c6e22d00912c78336ab58065f39e6 100644 (file)
@@ -1261,7 +1261,10 @@ PHP_FUNCTION(ldap_explode_dn)
        convert_to_string_ex(dn);
        convert_to_long_ex(with_attrib);
 
-       ldap_value = ldap_explode_dn(Z_STRVAL_PP(dn), Z_LVAL_PP(with_attrib));
+       if (!(ldap_value = ldap_explode_dn(Z_STRVAL_PP(dn), Z_LVAL_PP(with_attrib)))) {
+               /* Invalid parameters were passed to ldap_explode_dn */
+               RETURN_FALSE;
+       }
 
        i=0;
        while (ldap_value[i] != NULL) i++;