From cc435c3e92519d70765687eb85a4f049070e62a2 Mon Sep 17 00:00:00 2001 From: versat Date: Mon, 11 Dec 2017 10:25:59 +0100 Subject: [PATCH] Add missing tests for strncpy Add tests for verifying that the bufferoverrun tests are correct. --- test/cfg/std.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cfg/std.c b/test/cfg/std.c index 111849f75..c02adf49e 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -48,6 +48,11 @@ void bufferAccessOutOfBounds(void) // cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress redundantCopy strncpy(a,"abcde",6); + // cppcheck-suppress bufferAccessOutOfBounds + // cppcheck-suppress redundantCopy + strncpy(a,"a",6); + // cppcheck-suppress redundantCopy + strncpy(a,"abcdefgh",4); fread(a,1,5,stdin); // cppcheck-suppress bufferAccessOutOfBounds fread(a,1,6,stdin);