]> granicus.if.org Git - clang/commit
[analyzer] Don't flag strcpy of string literals into sufficiently large buffers.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 12 Jan 2018 22:12:11 +0000 (22:12 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 12 Jan 2018 22:12:11 +0000 (22:12 +0000)
commitbdecb5f0d423364d024597699ffd3838cea08035
tree389c1001910fc779b5189bf1bc2acddb961923e6
parent3fb45fcca06352aeb81acf80f292e8f6a1ca2339
[analyzer] Don't flag strcpy of string literals into sufficiently large buffers.

In the security package, we have a simple syntactic check that warns about
strcpy() being insecure, due to potential buffer overflows.

Suppress that check's warning in the trivial situation when the source is an
immediate null-terminated string literal and the target is an immediate
sufficiently large buffer.

Patch by AndrĂ¡s Leitereg!

Differential Revision: https://reviews.llvm.org/D41384

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322410 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
test/Analysis/security-syntax-checks.m