Closed
Bug 95517
Opened 24 years ago
Closed 24 years ago
encodeURI[Component] memory corruption
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
People
(Reporter: epstein, Assigned: khanson)
Details
(Keywords: js1.5)
Attachments
(4 files)
541 bytes,
patch
|
Details | Diff | Splinter Review | |
828 bytes,
patch
|
Details | Diff | Splinter Review | |
837 bytes,
patch
|
Details | Diff | Splinter Review | |
1.33 KB,
patch
|
Details | Diff | Splinter Review |
Encode(), called by encodeURI() and encodeURIComponent(), assumes that a
shrinking realloc always returns the same buffer. On Solaris, that is not true
for realloc of buffers smaller than 32 bytes, so encodeURI() of a string under
16 (double-byte) characters results in a JSString whose "chars" don't belong to
it, leading to possibly corrupt results.
I will attach the trivial patch shortly.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
Decode() has the same problem. New patch coming.
Reporter | ||
Comment 3•24 years ago
|
||
Reporter | ||
Comment 4•24 years ago
|
||
Comment 5•24 years ago
|
||
Formally confirming; reassigning to khanson; cc'ing Brendan -
Assignee: rogerl → khanson
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 6•24 years ago
|
||
Shrinking reallocs are allowed to move, indeed. r/sr=brendan@mozilla.org on
Mike's last patch (although prevailing style puts a space after the cast, and in
the cast before the * -- (jschar *) JS_realloc(...) -- style nit of the day).
/be
Comment 7•24 years ago
|
||
Let's get this in ASAP for 0.9.4, no reason to miss that boat.
/be
Keywords: js1.5,
mozilla0.9.4
Comment 8•24 years ago
|
||
Just need an r=, I'll do the checkin. Sorry for the spam!
/be
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
Looking for another sr=, as well as r=.
/be
Comment 11•24 years ago
|
||
r/sr=jband
Comment 12•24 years ago
|
||
Fix checked in.
/be
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•