[PATCH] D71566: New checks for fortified sprintf

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 23 06:03:19 PST 2020


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D71566#1834472 <https://reviews.llvm.org/D71566#1834472>, @serge-sans-paille wrote:

> In D71566#1832394 <https://reviews.llvm.org/D71566#1832394>, @aaron.ballman wrote:
>
> > (There are still some minor whitespace nits to resolve as well.)
>
>
> Strange, everything is passed through clang-format-diff :-/


They may have been manually inserted by accident? It's newlines in a few places, I added phab review comments at them.

On the whole, I think this LGTM, assuming the requested test cases don't discover issues.



================
Comment at: clang/test/Sema/warn-fortify-source.c:127
+
+void call_sprintf() {
+  char buf[6];
----------------
I'd like to see some additional tests for things like the `+` and ` ` flags, length modifiers like `ll`, escape characters, etc. Basically, we should be testing most of the conversion specifiers to verify our conservative length calculations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71566





More information about the cfe-commits mailing list