summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/cstring-syntax.c
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2018-07-23 18:26:38 +0000
committerDavid Carlier <devnexen@gmail.com>2018-07-23 18:26:38 +0000
commit2ea81639bd61c4480ba57535cb142017b07e2633 (patch)
tree23d229d8fc5ee163c2a6673ae446b22c01a6943b /clang/test/Analysis/cstring-syntax.c
parentdbae8cdb89bc876b1c56a051d90ab3dbd4732663 (diff)
downloadbcm5719-llvm-2ea81639bd61c4480ba57535cb142017b07e2633.tar.gz
bcm5719-llvm-2ea81639bd61c4480ba57535cb142017b07e2633.zip
[CStringSyntaxChecker] Improvements of strlcpy check
Adding an additional check whenwe offset fro the buffer base address. Reviewers: george.karpenkov,NoQ Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D49633 llvm-svn: 337721
Diffstat (limited to 'clang/test/Analysis/cstring-syntax.c')
-rw-r--r--clang/test/Analysis/cstring-syntax.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/Analysis/cstring-syntax.c b/clang/test/Analysis/cstring-syntax.c
index f64682b418d..fe1253bedba 100644
--- a/clang/test/Analysis/cstring-syntax.c
+++ b/clang/test/Analysis/cstring-syntax.c
@@ -31,4 +31,5 @@ void testStrlcpy(const char *src) {
strlcpy(dest, src, badlen); // expected-warning {{The third argument is larger than the size of the input buffer. Replace with the value 'sizeof(dest)` or lower}}
strlcpy(dest, src, ulen);
strlcpy(dest + 5, src, 5);
+ strlcpy(dest + 5, src, 10); // expected-warning {{The third argument is larger than the size of the input buffer.}}
}
OpenPOWER on IntegriCloud