Closed
Bug 239405
Opened 20 years ago
Closed 20 years ago
strchr, strrchr, etc. implicit const_cast can cause problems for shared string buffers
Categories
(Core :: XPCOM, defect, P1)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.7final
People
(Reporter: darin.moz, Assigned: darin.moz)
Details
Attachments
(1 file)
26.12 KB,
patch
|
Bienvenu
:
review+
dbaron
:
superreview+
chofmann
:
approval1.7+
|
Details | Diff | Splinter Review |
strchr, strrchr, etc. implicit const_cast can cause problems for shared string buffers. see bug 239226. we need to do some careful grepping of the tree to catch these kinds of problems.
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Flags: blocking1.7?
Priority: -- → P1
Target Milestone: --- → mozilla1.7final
Assignee | ||
Comment 1•20 years ago
|
||
got about a dozen or so hits... attaching patch...
Assignee | ||
Comment 2•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #145317 -
Flags: superreview?(dbaron)
Attachment #145317 -
Flags: review?(bienvenu)
Comment 3•20 years ago
|
||
> // move past "data:"
>- const char *buffer = strstr(spec.get(), "data:");
>+ const char *buffer = strstr(spec.BeginWriting(), "data:");
> if (!buffer) {
> // malfored url
> return NS_ERROR_MALFORMED_URI;
> }
> buffer += 5;
>
> // First, find the start of the data
> char *comma = PL_strchr(buffer, ',');
Shouldn't buffer have its constness removed too, for consistency?
Assignee | ||
Comment 4•20 years ago
|
||
neil: yeah, good point. i'll make that change.
Updated•20 years ago
|
Attachment #145317 -
Flags: review?(bienvenu) → review+
Comment on attachment 145317 [details] [diff] [review] v1 patch sr=dbaron given comment 3
Attachment #145317 -
Flags: superreview?(dbaron) → superreview+
Assignee | ||
Updated•20 years ago
|
Attachment #145317 -
Flags: approval1.7?
Comment 6•20 years ago
|
||
Comment on attachment 145317 [details] [diff] [review] v1 patch a=chofmann for 1.7
Attachment #145317 -
Flags: approval1.7? → approval1.7+
Assignee | ||
Comment 7•20 years ago
|
||
fixed-on-trunk for 1.7 final
Assignee | ||
Comment 8•20 years ago
|
||
.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Flags: blocking1.7?
Updated•3 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•