[asterisk-bugs] [Asterisk 0016397]: Segfault in res_config_ldap

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Dec 15 16:32:59 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16397 
====================================================================== 
Reported By:                bklang
Assigned To:                suretec
====================================================================== 
Project:                    Asterisk
Issue ID:                   16397
Category:                   Resources/res_config_ldap
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.1 
SVN Revision (number only!): 233048 
Request Review:              
====================================================================== 
Date Submitted:             2009-12-04 17:59 CST
Last Modified:              2009-12-15 16:32 CST
====================================================================== 
Summary:                    Segfault in res_config_ldap
Description: 
My system has been crashing intermittently today since I enabled
res_config_ldap.  At the moment I don't have many clues because it happens
when I am not watching the console.  However it appears to be related to an
attempt to update LDAP for a RealTime SIP peer, though at the time of the
crash no actual RealTime SIP peers were active.  Non-RealTime SIP peers
were active (configured in sip.conf).

Attached is the output from gdb (bt; bt full; thread apply all bt).
Please let me know if I can provide any additional information.
====================================================================== 

---------------------------------------------------------------------- 
 (0115304) applsplatz (reporter) - 2009-12-15 16:32
 https://issues.asterisk.org/view.php?id=16397#c115304 
---------------------------------------------------------------------- 
I believe I have fixed this issue.

update_ldap() initially allocates memory for ldap_mods[0]->mod_values,
which becomes an array of two addresses, the first to a char * and the
second as NULL.  ldap_mods[0]->mod_values was only allocated two bytes
rather than the 8 bytes needed for two memory addresses.  Changing the line
to "sizeof(char *)" fixes this issue on my system.

I'm attaching a patch called res_config_ldap.patch.  Enjoy. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-12-15 16:32 applsplatz     Note Added: 0115304                          
======================================================================




More information about the asterisk-bugs mailing list