pollita Sat Sep 13 13:31:07 2003 EDT
Modified files:
/php-src/ext/ldap ldap.c
Log:
Fix Bug #25525 ldap_explode_dn crashes when passed invalid params.
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.146 php-src/ext/ldap/ldap.c:1.147
--- php-src/ext/ldap/ldap.c:1.146 Sun Aug 31 16:45:45 2003
+++ php-src/ext/ldap/ldap.c Sat Sep 13 13:31:07 2003
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.146 2003/08/31 20:45:45 iliaa Exp $ */
+/* $Id: ldap.c,v 1.147 2003/09/13 17:31:07 pollita Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -302,7 +302,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "LDAP Support", "enabled");
- php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.146 2003/08/31
20:45:45 iliaa Exp $");
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.147 2003/09/13
17:31:07 pollita Exp $");
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1261,7 +1261,10 @@
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++;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php