This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] ArrayBoundCheckerV2: suppress false positives from ctype macros
ClosedPublic

Authored by donat.nagy on Apr 28 2023, 9:39 AM.

Details

Summary

The checker alpha.security.ArrayBoundV2 created bug reports in situations when the (tainted) result of fgetc() or getchar() was passed to one of the isXXXXX() macros from ctype.h. This is a common input handling pattern (within the limited toolbox of the C language) and several open source projects contained code where it led to false positive reports; so this commit suppresses ArrayBoundV2 reports generated within the isXXXXX() macros. (Note that here even true positive reports would be difficult to understand, as they'd refer to the implementation details of these macros.)

Diff Detail

Event Timeline

donat.nagy created this revision.Apr 28 2023, 9:39 AM
Herald added a project: Restricted Project. · View Herald Transcript
donat.nagy requested review of this revision.Apr 28 2023, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2023, 9:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
steakhal accepted this revision.May 3 2023, 7:18 AM

LGTM.

This revision is now accepted and ready to land.May 3 2023, 7:18 AM