Resolves this bug:
https://bugs.llvm.org/show_bug.cgi?id=38369
Paths
| Differential D78490
[dfsan] Fix a bug in strcasecmp() and strncasecmp(): Compare the lowercase versions of the characters when choosing a return value. ClosedPublic Authored by skerner on Apr 20 2020, 6:45 AM.
Details Summary Resolves this bug: https://bugs.llvm.org/show_bug.cgi?id=38369
Diff Detail
Event Timelinemorehouse added inline comments. This revision is now accepted and ready to land.Apr 20 2020, 8:48 AM skerner marked 2 inline comments as done. Comment ActionsAddress review comments.
This revision now requires changes to proceed.Apr 20 2020, 2:51 PM Comment Actions
Done. PTAL. This revision is now accepted and ready to land.Apr 20 2020, 5:12 PM Closed by commit rGe5ce95c660ae: [dfsan] Fix a bug in strcasecmp() and strncasecmp(): Compare the lowercase… (authored by skerner, committed by morehouse). · Explain WhyApr 20 2020, 5:22 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 258854 compiler-rt/lib/dfsan/dfsan_custom.cpp
compiler-rt/test/dfsan/custom.cpp
|
IIUC, this test would still pass with the buggy code. I think the case we want is:
Since 'y' - 'Z' > 0 but 'y' - 'z' < 0.