This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] CStringChecker should check the first byte of the destination of strcpy, strncpy
ClosedPublic

Authored by steakhal on Aug 29 2023, 8:21 AM.

Details

Summary

By not checking if the first byte of the destination of strcpy and
strncpy is writable, we missed some reports in the Juliet benchmark.

(Juliet CWE-124 Buffer Underwrite: strcpy, strncpy)

Diff Detail

Event Timeline

steakhal created this revision.Aug 29 2023, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 8:21 AM
steakhal requested review of this revision.Aug 29 2023, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 8:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
donat.nagy accepted this revision.Aug 30 2023, 3:38 AM

LGTM if the test results are good.

This revision is now accepted and ready to land.Aug 30 2023, 3:38 AM