This is an archive of the discontinued LLVM Phabricator instance.

[clang][analyzer] Display buffer sizes in StdCLibraryFunctionArgs checker
ClosedPublic

Authored by balazske on Apr 27 2023, 1:02 AM.

Details

Summary

If a wrong (too small) buffer argument is found, the dynamic buffer size and
values of connected arguments are displayed in the warning message, if
these are simple known integer values.

Diff Detail

Event Timeline

balazske created this revision.Apr 27 2023, 1:02 AM
Herald added a reviewer: NoQ. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
balazske requested review of this revision.Apr 27 2023, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Szelethus accepted this revision.Apr 27 2023, 1:20 AM
Szelethus added reviewers: steakhal, gamesh411.

I am Szelethus, and I approve this warning message!

Now, on another issue, if we can output such a thorough message, we should start to consider that in the few cases where we cannot, maybe we should just choose to suppress the warning. But that is a job for another patch.

This revision is now accepted and ready to land.Apr 27 2023, 1:20 AM
Szelethus added inline comments.Apr 27 2023, 1:58 AM
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
889

I think this would be correct.

balazske updated this revision to Diff 517554.Apr 27 2023, 7:46 AM

using "wihch" at argument values

This revision was landed with ongoing or failed builds.May 17 2023, 12:34 AM
This revision was automatically updated to reflect the committed changes.