php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5982 ldap_add and ldap_modify crash PHP
Submitted: 2000-08-05 05:35 UTC Modified: 2000-08-11 05:20 UTC
From: kurtkrueger at usa dot net Assigned: sniper (profile)
Status: Closed Package: LDAP related
PHP Version: 4.0.1pl2 OS: Mandrake Linux 7.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kurtkrueger at usa dot net
New email:
PHP Version: OS:

 

 [2000-08-05 05:35 UTC] kurtkrueger at usa dot net
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-06 03:21 UTC] sniper@php.net
Please try latest CVS. This should be fixed there.

--Jani
 [2000-08-11 05:20 UTC] sniper@php.net
Works for me (latest CVS). Closed.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC