cvs: php-src(PHP_5_2) /ext/ldap ldap.c
| From: | Jani Taskinen | Date: | Fri, 13 Jul 2007 02:00:39 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/ldap ldap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-45338@lists.php.net to get a copy of this message | ||
jani Fri Jul 13 02:00:39 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/ldap ldap.c
Log:
MFH: - Make sure people call ldap_first_attribute() before ldap_next_attribute()
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.7&r2=1.161.2.3.2.8&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.7 php-src/ext/ldap/ldap.c:1.161.2.3.2.8
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.7 Fri Jul 13 01:24:16 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 02:00:39 2007
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.161.2.3.2.7 2007/07/13 01:24:16 jani Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.8 2007/07/13 02:00:39 jani Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -322,7 +322,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.161.2.3.2.7 2007/07/13
01:24:16 jani Exp $");
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.8 2007/07/13
02:00:39 jani Exp $");
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1165,6 +1165,11 @@
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result
entry", le_result_entry);
+ if (resultentry->ber == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "called before calling ldap_first_attribute() or
no attributes found in result entry");
+ RETURN_FALSE;
+ }
+
if ((attribute = ldap_next_attribute(ld->link, resultentry->data, resultentry->ber)) ==
NULL) {
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
if (resultentry->ber != NULL) {