Bug 439588 - [mozilla/MozillaThunderbird] Thunderbird crashes when using nss_ldap
Summary: [mozilla/MozillaThunderbird] Thunderbird crashes when using nss_ldap
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 11.1
Classification: openSUSE
Component: Firefox (show other bugs)
Version: Factory
Hardware: All Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Wolfgang Rosenauer
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on: 157078
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-28 17:38 UTC by Stefan Brüns
Modified: 2008-12-28 22:13 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
suggested patch (1.03 KB, patch)
2008-10-28 17:38 UTC, Stefan Brüns
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2008-10-28 17:38:13 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
Comment 1 Wolfgang Rosenauer 2008-10-28 19:05:10 UTC
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)
Comment 2 Wolfgang Rosenauer 2008-12-28 22:13:20 UTC
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