Closed
Bug 1426989
Opened 6 years ago
Closed 6 years ago
NS_strncmp returns incorrect resuts when the string is longer than aLen
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: emk, Assigned: emk)
Details
Attachments
(1 file, 1 obsolete file)
2.65 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Attachment #8938784 -
Attachment is obsolete: true
Attachment #8938784 -
Flags: review?(erahm)
Attachment #8938786 -
Flags: review?(erahm)
Assignee | ||
Comment 3•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=470f705f7796c1818b14bad3438fecca0f828623
Comment 4•6 years ago
|
||
Comment on attachment 8938786 [details] [diff] [review] 1426989_NS_strncmp Review of attachment 8938786 [details] [diff] [review]: ----------------------------------------------------------------- r=me ::: xpcom/base/nsCRTGlue.cpp @@ +116,5 @@ > ++aStrB; > --aLen; > } > > + return aLen ? *aStrA != '\0' : 0; Wow, good find! ::: xpcom/tests/gtest/TestCRT.cpp @@ +47,5 @@ > const char16_t* us1 = t1.get(); > const char16_t* us2 = t2.get(); > > + int u2, u2_n; > + // nsCRT::strncmp will cause buffer overrun We should really fix that, bug 1427023 might be the right place. @@ +89,5 @@ > + > + { "foo", "foobar", 3 }, > + { "foobar", "foo", 3 }, > + { "foobar", "foozap", 3 }, > + { "foozap", "foobar", 3 }, Thanks for updating the tests.
Attachment #8938786 -
Flags: review?(erahm) → review+
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/mozilla-inbound/rev/06d4983f64fe Fix NS_strncmp. r=erahm
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/06d4983f64fe
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•