diff --git a/cfg/std.cfg b/cfg/std.cfg index e079caa7a..96fcc9a47 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -5088,10 +5088,15 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun false - + + + + + + diff --git a/test/cfg/std.c b/test/cfg/std.c index d266bee45..6624022f2 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -3550,6 +3550,17 @@ void uninitvar_strxfrm(void) (void)strxfrm(ds,ss,n); } +void bufferAccessOutOfBounds_strxfrm(void) +{ + const char src[3] = "abc"; + char dest[1] = "a"; + (void)strxfrm(dest,src,1); + // TODO cppcheck-suppress bufferAccessOutOfBounds + (void)strxfrm(dest,src,2); + // TODO cppcheck-suppress bufferAccessOutOfBounds + (void)strxfrm(dest,src,3); +} + void uninitvar_wcsxfrm(void) { wchar_t *ds;