Closed
Bug 1308094
Opened 6 years ago
Closed 9 months ago
Replace PL_strdup/PL_strfree with strdup / free
Categories
(Core :: XPCOM, defect, P5)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
93 Branch
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: cpeterson, Assigned: smurfd)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [lang=c++][ele:1a])
Attachments
(3 files)
We want to replace NSPR functions with standard C functions if they available on all platforms. This bug is probably not a good-first-bug because there are some special cases to consider. 1. Replace PL_strdup() calls with strdup() outside of nsprpub/ and security/nss code: https://searchfox.org/mozilla-central/search?q=PL_strdup&path=.cpp%24&case=false®exp=false *** CAUTION: PL_strdup(nullptr) will return "", but strdup(nullptr) will crash! Any calls to PL_strdup() that are changed to strdup() should be carefully audited to see if they might need to handle a null pointer, with code like strdup(str ? str : "") or maybe returning an error. 2. Replace PL_strfree() calls with free(): https://searchfox.org/mozilla-central/search?q=PL_strfree&path=.cpp%24&case=false®exp=false 3. Add #include <string.h> if it's needed for strdup()'s function declaration. 4. Remove #include "plstr.h" if it's no longer needed for other NSPR string function declarations.
Reporter | ||
Updated•6 years ago
|
Mentor: cpeterson
Reporter | ||
Comment 1•6 years ago
|
||
Waldo recommends using a safer Gecko string class or function instead of just swapping PL_strdup() for strdup().
Summary: Replace PL_strdup/PL_strfree with strdup/free → Replace PL_strdup/PL_strfree with a safer Gecko string class or function
Whiteboard: [lang=c++] → [lang=c++][ele:1a]
Reporter | ||
Updated•2 years ago
|
Component: General → String
Updated•2 years ago
|
Component: String → XPCOM
Assignee | ||
Comment 2•9 months ago
|
||
Updated•9 months ago
|
Assignee: nobody → smurfd
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•9 months ago
|
||
Depends on D122148
Assignee | ||
Comment 4•9 months ago
|
||
Depends on D122149
Updated•9 months ago
|
Attachment #9235459 -
Attachment description: Bug 1308094 - Replace PL_strdup/PL_strfree with a safer Gecko string class or function r=#necko-reviewers → Bug 1308094 - Remove deprecrated PL_strdup calls from toolkit code r=gijs
Updated•9 months ago
|
Attachment #9235459 -
Attachment description: Bug 1308094 - Remove deprecrated PL_strdup calls from toolkit code r=gijs → Bug 1308094 - Remove deprecrated PL_strdup calls from toolkit code r=gijs
Updated•9 months ago
|
Attachment #9235460 -
Attachment description: Bug 1308094 - Replace PL_strdup/PL_strfree with a safer Gecko string class or function r=#xpcom-reviewers → Bug 1308094 - Remove PL_strdup and PL_strfree from BloatEntry r=#xpcom-reviewers,mccr8
Updated•9 months ago
|
Attachment #9235459 -
Attachment description: Bug 1308094 - Remove deprecrated PL_strdup calls from toolkit code r=gijs → Bug 1308094 - Remove deprecated PL_strdup calls from toolkit code r=gijs
Updated•9 months ago
|
Attachment #9235461 -
Attachment description: Bug 1308094 - Replace PL_strdup/PL_strfree with a safer Gecko string class or function r=valentin → Bug 1308094 - Remove deprecated PL_strdup and PL_strfree calls from modules code r=valentin
Assignee | ||
Updated•9 months ago
|
Summary: Replace PL_strdup/PL_strfree with a safer Gecko string class or function → Replace PL_strdup/PL_strfree with strdup / free
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/48be7a726d32 Remove deprecated PL_strdup calls from toolkit code r=Gijs https://hg.mozilla.org/integration/autoland/rev/da16c4f3a988 Remove PL_strdup and PL_strfree from BloatEntry r=xpcom-reviewers,mccr8 https://hg.mozilla.org/integration/autoland/rev/ada63ac5146d Remove deprecated PL_strdup and PL_strfree calls from modules code r=valentin
Comment 6•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/48be7a726d32
https://hg.mozilla.org/mozilla-central/rev/da16c4f3a988
https://hg.mozilla.org/mozilla-central/rev/ada63ac5146d
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
status-firefox93:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•