std.cfg: Added more tests for strcat() and strcpy().
This commit is contained in:
parent
e683f3ce28
commit
ce35a6c975
|
@ -3113,6 +3113,28 @@ void uninitvar_strcat(char *dest, const char * const source)
|
|||
(void)strcat(dest,source);
|
||||
}
|
||||
|
||||
void nullPointer_strcpy(char *dest, const char * const source)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strcpy(NULL,source);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strcpy(dest,NULL);
|
||||
|
||||
// no warning shall be shown for
|
||||
(void)strcpy(dest,source);
|
||||
}
|
||||
|
||||
void nullPointer_strcat(char *dest, const char * const source)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strcat(NULL,source);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strcat(dest,NULL);
|
||||
|
||||
// no warning shall be shown for
|
||||
(void)strcat(dest,source);
|
||||
}
|
||||
|
||||
void bufferAccessOutOfBounds_strcat(char *dest, const char * const source)
|
||||
{
|
||||
char buf4[4] = {0};
|
||||
|
|
|
@ -1293,6 +1293,28 @@ void nullPointer_strncat(char *d, char *s, size_t n)
|
|||
(void)std::strncat(d,s,n);
|
||||
}
|
||||
|
||||
void nullPointer_strcpy(char *dest, const char * const source)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strcpy(NULL,source);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strcpy(dest,NULL);
|
||||
|
||||
// no warning shall be shown for
|
||||
(void)std::strcpy(dest,source);
|
||||
}
|
||||
|
||||
void nullPointer_strcat(char *dest, const char * const source)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strcat(NULL,source);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strcat(dest,NULL);
|
||||
|
||||
// no warning shall be shown for
|
||||
(void)std::strcat(dest,source);
|
||||
}
|
||||
|
||||
void nullPointer_strncpy(char *d, const char *s, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
|
|
Loading…
Reference in New Issue