[JDEV] ljud-0.1 segfault fix

Jeff Hoover jeff.hoover at infotechfl.com
Tue Dec 2 15:25:01 CST 2003


Whenever I search in the Nickname field and no results are returned, the 
jabberd process segfaults.  It does not happen in any of the other fields.

What was happening in ljud_search.c:

Line 307: if ( ldap_count_values(vals) ) ldap_value_free(vals);

Line 307 is where the script was crashing if the nickname didn't return 
results.  ldap_count_values(vals) was 1 and ldap_value_free then 
crashed.  However, vals should not be set, as it is not for any other 
search that didn't return anything.  What is vals then, I suspect some garbage?

Solution:
Changed line 53 from:
     char **vals;
To:
     char **vals = NULL;

I don't know why or how, it just worked for us.

Thanks,
Jeff Hoover




More information about the JDev mailing list