Skip to content

Commit 1367f16

Browse files
Update std.c
1 parent 8c6a368 commit 1367f16

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎test/cfg/std.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,20 @@ void bufferAccessOutOfBounds_wcsncpy()
616616
wcsncpy(s, L"abc", 17);
617617
}
618618

619+
void bufferAccessOutOfBounds_wmemcpy()
620+
{
621+
wchar_t a[4];
622+
// cppcheck-suppress bufferAccessOutOfBounds
623+
wmemcpy(a, L"abcd", 5);
624+
}
625+
626+
int bufferAccessOutOfBounds_wmemcmp(const wchar_t* b)
627+
{
628+
const wchar_t a[4] = { L'a', L'b', L'c', L'd' };
629+
// cppcheck-suppress bufferAccessOutOfBounds
630+
return wmemcmp(a, b, 5);
631+
}
632+
619633
int nullPointer_wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n)
620634
{
621635
// cppcheck-suppress nullPointer

0 commit comments

Comments
 (0)