Bugzilla – Bug 439588
[mozilla/MozillaThunderbird] Thunderbird crashes when using nss_ldap
Last modified: 2008-12-28 22:13:20 UTC
Created attachment 248383 [details] suggested patch thunderbirds included libldap uses strtok on a (readonly?) string, which results in a segfault. The same problem can be triggered by this small program: ------ #include <string.h> main() { const char* brk = ", "; char* str = "ldap://localhost/"; char* str2; str2 = strdup(str); char* s; s = strtok( str2, ", " ); // <= works s = strtok( str, ", " ); // <= segfault } ------- patch is attached Problem is solved the same way in openldap's libldap client library
Interesting. That would probably fix the crash which is also mentioned in bug 157078 while the other bug is more about colliding symbol namespaces (what is most probably the reason for that crash to happen anyway). So this patch looks sane but a few more questions: - Have you also filed a bug (or just the patch) somewhere in bugzilla.mozilla.org or just here? - So Thunderbird's LDAP functions behave correctly with that patch applied? (because we still pull in different functions from openldap and mozldap)
The patch ended up in the 11.1 package at least and I reported it upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=471348