[PATCH] D23820: Do not warn about format strings that are indexed string literals.
Meike Baumgärtner via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 23 15:52:26 PDT 2016
meikeb created this revision.
meikeb added a reviewer: rsmith.
meikeb added a subscriber: cfe-commits.
The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the string literal is
precomputable. If thats the case it will check if the suffix of that
sting literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indecies into the
string literal.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23820.69053.patch
Type: text/x-patch
Size: 8124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160823/d3a84d10/attachment-0001.bin>
More information about the cfe-commits
mailing list