diff options
author | Jani Taskinen <jani@php.net> | 2007-07-13 02:00:39 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2007-07-13 02:00:39 +0000 |
commit | 3dff7a7dba9f2ae20854586836a59c7c37b0944a (patch) | |
tree | 142833b8143c97f170f1ad81f6120184f02f1448 | |
parent | 95f8148f1862196d7cc3eb186e44619da3f29cbb (diff) | |
download | php-git-3dff7a7dba9f2ae20854586836a59c7c37b0944a.tar.gz |
MFH: - Make sure people call ldap_first_attribute() before ldap_next_attribute()
-rw-r--r-- | ext/ldap/ldap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 77a44dd8c8..4fb5febe1c 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1165,6 +1165,11 @@ PHP_FUNCTION(ldap_next_attribute) 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) { |