std.cfg: Fixed bufferAccessOutOfBounds false negative for strncmp().
This commit is contained in:
parent
03bdcc4c42
commit
f62d9d5853
|
@ -5000,10 +5000,14 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
|
|
|
@ -3561,6 +3561,17 @@ void bufferAccessOutOfBounds_strxfrm(void)
|
|||
(void)strxfrm(dest,src,3);
|
||||
}
|
||||
|
||||
void bufferAccessOutOfBounds_strncmp(void)
|
||||
{
|
||||
const char src[3] = "abc";
|
||||
char dest[1] = "a";
|
||||
(void)strncmp(dest,src,1);
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void)strncmp(dest,src,2);
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void)strncmp(dest,src,3);
|
||||
}
|
||||
|
||||
void uninitvar_wcsxfrm(void)
|
||||
{
|
||||
wchar_t *ds;
|
||||
|
|
Loading…
Reference in New Issue