Travis: redundantCopy is not detected at the moment

This commit is contained in:
Daniel Marjamäki 2018-11-24 11:27:27 +01:00
parent a3921ea861
commit ec89c7b1b8
2 changed files with 12 additions and 12 deletions

View File

@ -32,27 +32,27 @@ void bufferAccessOutOfBounds(void)
fgets(a,6,stdin); fgets(a,6,stdin);
sprintf(a, "ab%s", "cd"); sprintf(a, "ab%s", "cd");
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
sprintf(a, "ab%s", "cde"); sprintf(a, "ab%s", "cde");
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
snprintf(a, 5, "abcde%i", 1); snprintf(a, 5, "abcde%i", 1);
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
snprintf(a, 6, "abcde%i", 1); snprintf(a, 6, "abcde%i", 1);
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strcpy(a,"abcd"); strcpy(a,"abcd");
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strcpy(a, "abcde"); strcpy(a, "abcde");
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strncpy(a,"abcde",5); strncpy(a,"abcde",5);
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strncpy(a,"abcde",6); strncpy(a,"abcde",6);
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strncpy(a,"a",6); strncpy(a,"a",6);
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
strncpy(a,"abcdefgh",4); strncpy(a,"abcdefgh",4);
// valid call // valid call
strncpy_s(a,5,"abcd",5); strncpy_s(a,5,"abcd",5);

View File

@ -75,12 +75,12 @@ void bufferAccessOutOfBounds(void)
char a[5]; char a[5];
std::strcpy(a,"abcd"); std::strcpy(a,"abcd");
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
std::strcpy(a, "abcde"); std::strcpy(a, "abcde");
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
std::strncpy(a,"abcde",5); std::strncpy(a,"abcde",5);
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy // TODO cppcheck-suppress redundantCopy
std::strncpy(a,"abcde",6); std::strncpy(a,"abcde",6);
} }