Closed
Bug 617913
Opened 14 years ago
Closed 14 years ago
FuzzOneInvalidCaseConversion could check result of CaseInsensitiveCompare/CharByCharCompareEqual
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity)
Attachments
(1 file, 1 obsolete file)
975 bytes,
patch
|
smontagu
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
coverity likes to be able to warn when the result of a function is only sometimes checked. typically when its result isn't checked, that's an accidental omission.
Assignee: smontagu → timeless
Status: NEW → ASSIGNED
Attachment #496483 -
Flags: review?(smontagu)
Attachment #496483 -
Flags: approval2.0?
Comment 2•14 years ago
|
||
Comment on attachment 496483 [details] [diff] [review]
check function calls
>- CaseInsensitiveCompare((char*)aBuf, (char*)bBuf, aLen, bLen);
>- CharByCharCompareEqual((char*)aBuf, (char*)bBuf, aLen, bLen);
>+ if (CaseInsensitiveCompare((char*)aBuf, (char*)bBuf, aLen, bLen))
>+ printf("\tSurprise, two random strings compared insensitively as equal!\n");
Shouldn't this be |if (!CaseInsensitiveCompare...| ?
>+ if (CharByCharCompareEqual((char*)aBuf, (char*)bBuf, aLen, bLen))
>+ printf("\tSurprise, two random strings compared as exactly equal!\n");
afaict they return true if strings compare as equal. since both strings are random, that shouldn't happen, so i'm checking for true.
Comment 4•14 years ago
|
||
Hmm. Afa*I*ct CaseInsensitiveCompare returns strcmp-style result codes so you should be testing for 0.
http://mxr.mozilla.org/mozilla-central/source/intl/unicharutil/util/nsUnicharUtils.cpp#478
right, one's a Compare and one's an Equals, how confusing. thanks.
Attachment #496483 -
Attachment is obsolete: true
Attachment #497253 -
Flags: review?(smontagu)
Attachment #497253 -
Flags: approval2.0?
Attachment #496483 -
Flags: review?(smontagu)
Attachment #496483 -
Flags: approval2.0?
Updated•14 years ago
|
Attachment #497253 -
Flags: review?(smontagu) → review+
Comment 6•14 years ago
|
||
Comment on attachment 497253 [details] [diff] [review]
oh!
Test-only, so approval really isn't needed.
Attachment #497253 -
Flags: approval2.0? → approval2.0+
Keywords: checkin-needed
Comment 7•14 years ago
|
||
Updated•6 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•