Closed Bug 5365 Opened 25 years ago Closed 15 years ago

use nsCRT::strtok() instead of strtok()

Categories

(MailNews Core :: Backend, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: sspitzer, Unassigned)

References

Details

Attachments

(1 file)

I wrote some code that used strtok() and alecf pointed out that strtok() is not thread safe. There is a thread safe version nsCRT::strtok() that I'm now using. This bug is to remind me to replace strtok() [and possibly XP_STRTOK] with nsCRT::strtok(). Imapstrok_r() should be fine how it is.
Status: NEW → ASSIGNED
Target Milestone: M6
setting target to M6
cc'ing chuang since the LDAP prefs code also uses strtok, so Candice you'll need to make this change if/when you port that code.
Target Milestone: M6 → M9
moving to m9.
QA Contact: 4080 → 4421
Should the platform be all? Or, is this a platform parity bug? Thanks.
OS: Linux → All
marking OS all. it is not a PP bug.
Hardware: PC → All
Does this need to be fixed for M9? If not, we should move this.
Target Milestone: M9 → M10
moving to m10. what we need to do is go through http://lxr.mozilla.org/seamonkey/ident?i=strtok and see where we are using nsCRT::strtok and where we are using strtok. regular strtok is not thread safe.
Target Milestone: M10 → M11
moving to m11. not dogfood.
Triage to M15
Assignee: sspitzer → bienvenu
Status: ASSIGNED → NEW
I'll take this.
moving to m16
Target Milestone: M15 → M16
Not beta2 stopper. Marking M18.
Target Milestone: M16 → M18
Depends on: 28952
Until/Unless 28952 is fixed, it would be wrong to fix this since I would be introducing bugs.
until 28952 is fixed, this won't be fixed. I'm moving this to future, since bug 28952 hasn't seen any action.
Target Milestone: M18 → Future
the one instance of strtok left in the mailnews code, in nsNNTPProtocol::DisplayNewsRCResponse(), doesn't need to be thread-safe because this code is only ever called on one thread. I suspect that's true for the remaining instances of XP_STRTOK in nsDirPrefs.cpp.
QA Contact: ppandit → stephend
After comparing a couple of queries: http://lxr.mozilla.org/seamonkey/ident?i=strtok http://lxr.mozilla.org/seamonkey/search?string=nsCRT%3A%3Astrtok it turns out that the only places where we are still using strtok() in the mailnews component are the following: * mailnews/addrbook/src/nsDirPrefs.cpp: o line 2248 o line 2251 o line 2256 o line 2261 o line 2379 o line 2383 * mailnews/news/src/nsNNTPProtocol.cpp: o line 4127
Product: MailNews → Core
Down to one place: nsNNTPProtocol.cpp
Attached patch The fix (deleted) — Splinter Review
One remaining instance, we may as well fix it, be consistent and close this bug. I think this is the fix we want.
Assignee: bienvenu → bugzilla
Attachment #323411 - Flags: superreview?(neil)
Attachment #323411 - Flags: review?(neil)
Comment on attachment 323411 [details] [diff] [review] The fix This isn't right, NS_strtok changes group.
Attachment #323411 - Flags: superreview?(neil)
Attachment #323411 - Flags: review?(neil)
Attachment #323411 - Flags: review-
QA Contact: stephend → backend
Product: Core → MailNews Core
Nominating wanted-thunderbird3 because of a partial patch and that it's down to one location only.
Flags: wanted-thunderbird3?
Bug 311774 removed the last remaining instance in nsNNTPProtocol.cpp. Therefore resolving this bug as WFM.
Assignee: bugzilla → nobody
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: wanted-thunderbird3?
Resolution: --- → WORKSFORME
Target Milestone: Future → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: