PHP 4.0 Bug #5982: ldap_add and ldap_modify crash PHP
| From: | kurtkrueger at usa dot net | Date: | Sat, 05 Aug 2000 03:35:50 +0000 |
| Subject: | PHP 4.0 Bug #5982: ldap_add and ldap_modify crash PHP | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-27799@lists.php.net to get a copy of this message | ||
From: kurtkrueger@usa.net
Operating system: Mandrake Linux 7.0
PHP version: 4.0.1pl2
PHP Bug Type: LDAP related
Bug description: ldap_add and ldap_modify crash PHP
PROBLEM:
I have a page which accepts user input and a page which processes that input. The input goes into
fields of an associative array. Next, the ldap_modify (or ldap_add) function is called:
ldap_modify ($connection, $dn, $inputArray)
PHP crashes immediately. This bug is new to PHP4 because the same code performed fine under PHP3.
WORKAROUND:
I have found that if I append a zero-length string to each field of the array, the LDAP functions
work perfectly. For instance:
$inputArray[department] = $txtDepartment . "";
SUPPORTING INFORMATION:
I am running Open LDAP, slapd version:
slapd 1.2.7-Release (Mon Sep 20 22:37:14 CDT 1999)
Here is a backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x403602b1 in php_ldap_do_modify (ht=3, return_value=0x8125d24, this_ptr=0x0,
return_value_used=1, oper=2) at ldap.c:1154
1154
ldap_mods[i]->mod_values[0][(*value)->value.str.len] = '\0';
(gdb) bt
#0 0x403602b1 in php_ldap_do_modify (ht=3, return_value=0x8125d24,
this_ptr=0x0, return_value_used=1, oper=2)
at ldap.c:1154
#1 0x4036059b in php_if_ldap_modify (ht=3, return_value=0x8125d24,
this_ptr=0x0, return_value_used=1) at ldap.c:1209
#2 0x4032f9f6 in execute (op_array=0x8120850) at ./zend_execute.c:1558
#3 0x4032fc43 in execute (op_array=0x80ba99c) at ./zend_execute.c:1598
#4 0x4034cbc1 in php_execute_script (primary_file=0xbffff65c) at main.c:1157
#5 0x40349399 in apache_php_module_main (r=0x80f574c, fd=19,
display_source_mode=0) at sapi_apache.c:93
#6 0x40349da4 in send_php (r=0x80f574c, display_source_mode=0,
filename=0x80f630c "/www/htdocs/ldap_mail/process_record.php") at mod_php4.c:515
#7 0x40349df0 in send_parsed_php (r=0x80f574c) at mod_php4.c:527
#8 0x80547d3 in ap_invoke_handler ()
#9 0x8068429 in process_request_internal ()
#10 0x806848c in ap_process_request ()
#11 0x805fc4e in child_main ()
#12 0x805fde8 in make_child ()
#13 0x805ff53 in startup_children ()
#14 0x8060596 in standalone_main ()
#15 0x8060d13 in main ()
#16 0x400819ee in __libc_start_main (main=0x80609e0 <main>, argc=2,
argv=0xbffff844, init=0x804e814 <_init>, fini=0x8095a4c <_fini>, rtld_fini=0x4000a570
<_dl_fini>,
stack_end=0xbffff83c) at ../sysdeps/generic/libc-start.c:90