posix.cfg: Added overlapping data check for stpcpy().

This commit is contained in:
orbitcowboy 2021-07-11 16:42:19 +02:00
parent d782cd629a
commit 01b68b99c6
2 changed files with 9 additions and 0 deletions

View File

@ -3889,6 +3889,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" strlen-arg="2"/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="strlen" arg="2"/>

View File

@ -29,6 +29,14 @@
#include <wchar.h>
#include <string.h>
char * overlappingWriteFunction_stpcpy(char *src, char *dest)
{
// No warning shall be shown:
(void) stpcpy(dest, src);
// cppcheck-suppress overlappingWriteFunction
return stpcpy(src, src);
}
void overlappingWriteFunction_bcopy(char *buf, const size_t count)
{
// No warning shall be shown: