posix.cfg: Added overlapping data check for bcopy().
This commit is contained in:
parent
9fb33e6a3c
commit
d782cd629a
|
@ -3803,6 +3803,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
||||||
<function name="bcopy">
|
<function name="bcopy">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
|
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
|
|
@ -29,6 +29,18 @@
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
void overlappingWriteFunction_bcopy(char *buf, const size_t count)
|
||||||
|
{
|
||||||
|
// No warning shall be shown:
|
||||||
|
// cppcheck-suppress bcopyCalled
|
||||||
|
bcopy(&buf[0], &buf[3], count); // size is not known
|
||||||
|
// cppcheck-suppress bcopyCalled
|
||||||
|
bcopy(&buf[0], &buf[3], 3U); // no-overlap
|
||||||
|
// cppcheck-suppress bcopyCalled
|
||||||
|
// cppcheck-suppress overlappingWriteFunction
|
||||||
|
bcopy(&buf[0], &buf[3], 4U);
|
||||||
|
}
|
||||||
|
|
||||||
void overlappingWriteFunction_memccpy(unsigned char *src, unsigned char *dest, int c, size_t count)
|
void overlappingWriteFunction_memccpy(unsigned char *src, unsigned char *dest, int c, size_t count)
|
||||||
{
|
{
|
||||||
// No warning shall be shown:
|
// No warning shall be shown:
|
||||||
|
|
Loading…
Reference in New Issue