Add missing tests for strncpy
Add tests for verifying that the bufferoverrun tests are correct.
This commit is contained in:
parent
d63897ff21
commit
cc435c3e92
|
@ -48,6 +48,11 @@ void bufferAccessOutOfBounds(void)
|
||||||
// cppcheck-suppress bufferAccessOutOfBounds
|
// cppcheck-suppress bufferAccessOutOfBounds
|
||||||
// cppcheck-suppress redundantCopy
|
// cppcheck-suppress redundantCopy
|
||||||
strncpy(a,"abcde",6);
|
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);
|
fread(a,1,5,stdin);
|
||||||
// cppcheck-suppress bufferAccessOutOfBounds
|
// cppcheck-suppress bufferAccessOutOfBounds
|
||||||
fread(a,1,6,stdin);
|
fread(a,1,6,stdin);
|
||||||
|
|
Loading…
Reference in New Issue