std.cfg: Added overlappingWriteFunction check to wcscpy().
This commit is contained in:
parent
a8fb0309fd
commit
c38a43c353
|
@ -4805,6 +4805,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<returnValue type="wchar_t *"/>
|
<returnValue type="wchar_t *"/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
|
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" strlen-arg="2"/>
|
||||||
<arg nr="1" direction="out">
|
<arg nr="1" direction="out">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
|
@ -30,6 +30,17 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
wchar_t * overlappingWriteFunction_wcscpy(wchar_t *src, wchar_t *dest)
|
||||||
|
{
|
||||||
|
// No warning shall be shown:
|
||||||
|
(void)wcscpy(dest, src);
|
||||||
|
const wchar_t * destBuf = dest;
|
||||||
|
// TODO-cppcheck-suppress overlappingWriteFunction #10355
|
||||||
|
(void)wcscpy(dest, destBuf);
|
||||||
|
// cppcheck-suppress overlappingWriteFunction
|
||||||
|
return wcscpy(src, src);
|
||||||
|
}
|
||||||
|
|
||||||
wchar_t * overlappingWriteFunction_wcsncpy(wchar_t *buf, const std::size_t count)
|
wchar_t * overlappingWriteFunction_wcsncpy(wchar_t *buf, const std::size_t count)
|
||||||
{
|
{
|
||||||
// No warning shall be shown:
|
// No warning shall be shown:
|
||||||
|
|
Loading…
Reference in New Issue