Closed
Bug 1426989
Opened 7 years ago
Closed 7 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)
(deleted),
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8938784 -
Attachment is obsolete: true
Attachment #8938784 -
Flags: review?(erahm)
Attachment #8938786 -
Flags: review?(erahm)
Assignee | ||
Comment 3•7 years ago
|
||
Comment 4•7 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•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 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
•