From: joseph dot r dot gruber at lmco dot com Operating system: Windows 2000 SP4 PHP version: 5.1.2 PHP Bug Type: LDAP related Bug description: ldap_search Causes Access Violation
Description: ------------ When attempting to search a Windows 2000 Active Directory via LDAP, PHP will crash with an Access Violation. This will only occur during certain (reproducible) LDAP queries. For example: Works: $s = ldap_search($conn,"DC=u,DC=contoso,DC=com","(&(objectCategory=group)(name=group.name.domain))",array("cn","samaccountname")); Doesn't Work: $s = ldap_search($conn,"DC=u,DC=contoso,DC=com","(&(objectCategory=group)(name=group.name.domain2))",array("cn","samaccountname")); Where the only difference is in the filter. Server: IIS 5.1 on Windows 2000 with PHP 5.1.2. Attempted 5.1.3 (latest snapshot) and issue still occurs. Reproduce code: --------------- <? $conn = ldap_connect("rootdc.contoso.com"); ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); $bind = ldap_bind($conn, "[EMAIL PROTECTED]", "paSSw0rd"); $filter = "(&(objectCategory=group)(name=group.name.domain2))"; $fields = array("member","cn","description","distinguishedname","objectcategory","samaccountname","canonicalname"); $search = ldap_search($conn,"DC=u,DC=contoso,DC=com",$filter,$fields); $entries = ldap_get_entries($conn, $search); var_dump($entries); ?> Expected result: ---------------- Expected to return fields listed in the $fields array in the $entries array. Actual result: -------------- The page load terminates and reports: "PHP has encountered an Access Violation at 01CE5CE6" Backtrace (NOTE: php.exe used for debugging. Normally use IIS5.1 w/php5isapi.dll): Unhandled exception in php.exe (PHP_LDAP.dll): 0xC0000005: Access Violation Call Stack: PHP_LDAP! 00f95ce6() Disassembly: 00F95CE6 mov eax,dword ptr [esi+18h] -- Edit bug report at http://bugs.php.net/?id=36559&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36559&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36559&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36559&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36559&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36559&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36559&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36559&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36559&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36559&r=support Expected behavior: http://bugs.php.net/fix.php?id=36559&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36559&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36559&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36559&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36559&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36559&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36559&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36559&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36559&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36559&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36559&r=mysqlcfg