Added more overlapping data configurations
This commit is contained in:
parent
7ad64891ea
commit
10fb1851c5
|
@ -4717,6 +4717,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<returnValue type="wchar_t *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
|
@ -4737,6 +4738,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<returnValue type="char *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
|
@ -4757,6 +4759,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<leak-ignore/>
|
||||
<returnValue type="void *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="4"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="sizeof" arg="2"/>
|
||||
|
|
|
@ -26,6 +26,35 @@
|
|||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
|
||||
void overlappingWriteFunction_memccpy(unsigned char *src, unsigned char *dest, int c, size_t count)
|
||||
{
|
||||
// No warning shall be shown:
|
||||
(void)memccpy(dest, src, c, count);
|
||||
(void)memccpy(dest, src, 42, count);
|
||||
// cppcheck-suppress overlappingWriteFunction
|
||||
(void)memccpy(dest, dest, c, 4);
|
||||
// cppcheck-suppress overlappingWriteFunction
|
||||
(void)memccpy(dest, dest+3, c, 4);
|
||||
}
|
||||
|
||||
void overlappingWriteFunction_stpncpy(char *src, char *dest, ssize_t n)
|
||||
{
|
||||
// No warning shall be shown:
|
||||
(void) stpncpy(dest, src, n);
|
||||
// cppcheck-suppress overlappingWriteFunction
|
||||
(void)stpncpy(src, src+3, 4);
|
||||
}
|
||||
|
||||
wchar_t* overlappingWriteFunction_wcpncpy(wchar_t *src, wchar_t *dest, ssize_t n)
|
||||
{
|
||||
// No warning shall be shown:
|
||||
(void) wcpncpy(dest, src, n);
|
||||
// cppcheck-suppress overlappingWriteFunction
|
||||
return wcpncpy(src, src+3, 4);
|
||||
}
|
||||
|
||||
void overlappingWriteFunction_swab(char *src, char *dest, ssize_t n)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue