std.cfg: Improved configuration of 'strncpy', which is vulnerable for overlapping write issues.
This commit is contained in:
parent
1c60dc090a
commit
58811808d5
|
@ -4853,6 +4853,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<returnValue type="char *"/>
|
<returnValue type="char *"/>
|
||||||
<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="out">
|
<arg nr="1" direction="out">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<minsize type="argvalue" arg="3"/>
|
<minsize type="argvalue" arg="3"/>
|
||||||
|
|
|
@ -30,6 +30,12 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
char * overlappingWriteFunction_strncpy(char *buf)
|
||||||
|
{
|
||||||
|
// cppcheck-suppress overlappingWriteFunction
|
||||||
|
return strncpy(&buf[0], &buf[3], 2U);
|
||||||
|
}
|
||||||
|
|
||||||
std::bitset<10> std_bitset_test_ignoredReturnValue()
|
std::bitset<10> std_bitset_test_ignoredReturnValue()
|
||||||
{
|
{
|
||||||
std::bitset<10> b1("1111010000");
|
std::bitset<10> b1("1111010000");
|
||||||
|
|
Loading…
Reference in New Issue