std.cfg: Improved configuration for wcsrtombs().
This commit is contained in:
parent
f48d1690a7
commit
d1b6954dd8
|
@ -5331,7 +5331,9 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<returnValue type="size_t"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="out"/>
|
||||
<arg nr="1" direction="out">
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
|
|
|
@ -25,6 +25,15 @@
|
|||
#include <inttypes.h>
|
||||
#include <float.h>
|
||||
|
||||
size_t bufferAccessOutOfBounds_wcsrtombs(char * dest, const wchar_t ** src, size_t len, mbstate_t * ps)
|
||||
{
|
||||
char buf[42];
|
||||
(void)wcsrtombs(buf,src,42,ps);
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void)wcsrtombs(buf,src,43,ps);
|
||||
return wcsrtombs(dest,src,len,ps);
|
||||
}
|
||||
|
||||
void bufferAccessOutOfBounds(void)
|
||||
{
|
||||
char a[5];
|
||||
|
|
|
@ -31,6 +31,15 @@
|
|||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
size_t bufferAccessOutOfBounds_wcsrtombs(char * dest, const wchar_t ** src, size_t len, mbstate_t * ps)
|
||||
{
|
||||
char buf[42];
|
||||
(void)std::wcsrtombs(buf,src,42,ps);
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void)std::wcsrtombs(buf,src,43,ps);
|
||||
return std::wcsrtombs(dest,src,len,ps);
|
||||
}
|
||||
|
||||
void invalidFunctionArg_std_string_substr(const std::string &str, std::size_t pos, std::size_t len) {
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)str.substr(-1,len);
|
||||
|
|
Loading…
Reference in New Issue