File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4723,6 +4723,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
47234723 <arg nr =" 1" direction =" in" >
47244724 <not-null/>
47254725 <not-uninit/>
4726+ <minsize type =" argvalue" arg =" 2" />
47264727 </arg>
47274728 <arg nr =" 2" direction =" in" >
47284729 <not-uninit/>
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ int nullPointer_wcsnlen(const wchar_t *s, size_t n)
4848 return wcsnlen (s , n );
4949}
5050
51+ size_t bufferAccessOutOfBounds_wcsnlen (const wchar_t * s , size_t maxlen )
52+ {
53+ wchar_t buf [2 ]= {L'4' ,L'2' };
54+ size_t len = wcsnlen (buf ,2 );
55+ // TODO cppcheck-suppress bufferAccessOutOfBounds
56+ len += wcsnlen (buf ,3 );
57+ return len ;
58+ }
59+
5160int nullPointer_gethostname (char * s , size_t n )
5261{
5362 // cppcheck-suppress nullPointer
@@ -272,6 +281,23 @@ void bufferAccessOutOfBounds_bzero(void *s, size_t n)
272281 bzero (s ,n );
273282}
274283
284+ size_t bufferAccessOutOfBounds_strnlen (const char * s , size_t maxlen )
285+ {
286+ char buf [2 ]= {'4' ,'2' };
287+ size_t len = strnlen (buf ,2 );
288+ // cppcheck-suppress bufferAccessOutOfBounds
289+ len += strnlen (buf ,3 );
290+ return len ;
291+ }
292+
293+ size_t nullPointer_strnlen (const char * s , size_t maxlen )
294+ {
295+ // No warning shall be shown:
296+ (void ) strnlen (s , maxlen );
297+ // cppcheck-suppress nullPointer
298+ return strnlen (NULL , maxlen );
299+ }
300+
275301char * nullPointer_stpcpy (char * src , char * dest )
276302{
277303 // No warning shall be shown:
You can’t perform that action at this time.
0 commit comments