[PATCH] D132294: [clang-tidy] Add check of sprintf with fixed size buffer

方程 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 00:48:11 PDT 2022


Yoorkin updated this revision to Diff 454722.
Yoorkin added a comment.

Now it can find usage of both `sprintf` and `vsprintf`, and then change a small piece of code. Here is an option `PreferSafe`, when value is true, the check prefers `snprintf_s` `vsnprintf_s` over `snprintf` `vsnprintf`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132294/new/

https://reviews.llvm.org/D132294

Files:
  clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
  clang-tools-extra/clang-tidy/bugprone/PrintfWithFixedSizeBufferCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/PrintfWithFixedSizeBufferCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/bugprone/printf-with-fixed-size-buffer.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/test/clang-tidy/checkers/bugprone/printf-with-fixed-size-buffer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132294.454722.patch
Type: text/x-patch
Size: 11230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220823/b80211ef/attachment.bin>


More information about the cfe-commits mailing list