From: fel...@php.net Operating system: Linux PHP version: 5.3CVS-2009-06-25 (CVS) PHP Bug Type: LDAP related Bug description: ldap_read() segfaults with invalid parameters
Description: ------------ See below. Reproduce code: --------------- ldap_read(1,1,1); Expected result: ---------------- Warning: ldap_read(): supplied argument is not a valid ldap link resource in Command line code on line 1 Actual result: -------------- Warning: ldap_read(): supplied argument is not a valid ldap link resource in Command line code on line 1 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb75756c0 (LWP 22084)] 0x0820b9ac in php_ldap_do_search (ht=3, return_value=0xa333094, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0, tsrm_ls=0xa19a070, scope=0) at /home/felipe/dev/php5/ext/ldap/ldap.c:810 810 php_set_opts(ld->link, old_ldap_sizelimit, old_ldap_timelimit, old_ldap_deref, &ldap_sizelimit, &ldap_timelimit, &ldap_deref); (gdb) bt #0 0x0820b9ac in php_ldap_do_search (ht=3, return_value=0xa333094, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0, tsrm_ls=0xa19a070, scope=0) at /home/felipe/dev/php5/ext/ldap/ldap.c:810 #1 0x0820baab in zif_ldap_read (ht=3, return_value=0xa333094, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/ext/ldap/ldap.c:824 #2 0x084a2328 in zend_do_fcall_common_helper_SPEC (execute_data=0xa361a54, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_vm_execute.h:313 #3 0x084a848f in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xa361a54, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_vm_execute.h:1601 #4 0x084a10ef in execute (op_array=0xa332f90, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_vm_execute.h:104 #5 0x084607f8 in zend_eval_stringl (str=0xbfc22807 "ldap_read(1,1,1);", str_len=17, retval_ptr=0x0, string_name=0x883dd94 "Command line code", tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_execute_API.c:1159 #6 0x08460a7f in zend_eval_stringl_ex (str=0xbfc22807 "ldap_read(1,1,1);", str_len=17, retval_ptr=0x0, string_name=0x883dd94 "Command line code", handle_exceptions=1, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_execute_API.c:1200 #7 0x08460b33 in zend_eval_string_ex (str=0xbfc22807 "ldap_read(1,1,1);", retval_ptr=0x0, string_name=0x883dd94 "Command line code", handle_exceptions=1, tsrm_ls=0xa19a070) at /home/felipe/dev/php5/Zend/zend_execute_API.c:1211 #8 0x085525a6 in main (argc=3, argv=0xbfc21ad4) at /home/felipe/dev/php5/sapi/cli/php_cli.c:1227 -- Edit bug report at http://bugs.php.net/?id=48696&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48696&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48696&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48696&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48696&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48696&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48696&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48696&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48696&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48696&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48696&r=support Expected behavior: http://bugs.php.net/fix.php?id=48696&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48696&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48696&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48696&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48696&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48696&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48696&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48696&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48696&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48696&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48696&r=mysqlcfg