File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,26 @@ void bufferAccessOutOfBounds(void)
8585 free (pAlloc1 );
8686}
8787
88+ wchar_t * nullPointer_fgetws (wchar_t * buffer , int n , FILE * stream )
89+ {
90+ // cppcheck-suppress nullPointer
91+ (void )fgetws (NULL ,n ,stream );
92+ // cppcheck-suppress nullPointer
93+ (void )fgetws (buffer ,n ,NULL );
94+ // No warning is expected
95+ return fgetws (buffer , n , stream );
96+ }
97+
98+ char * nullPointer_fgets (char * buffer , int n , FILE * stream )
99+ {
100+ // cppcheck-suppress nullPointer
101+ (void )fgets (NULL ,n ,stream );
102+ // cppcheck-suppress nullPointer
103+ (void )fgets (buffer ,n ,NULL );
104+ // No warning is expected
105+ return fgets (buffer , n , stream );
106+ }
107+
88108void memleak_aligned_alloc (void )
89109{
90110 // cppcheck-suppress unusedAllocatedMemory
Original file line number Diff line number Diff line change @@ -1264,6 +1264,26 @@ void uninitvar_fsetpos(void)
12641264 (void )std::fsetpos (stream,ptr);
12651265}
12661266
1267+ wchar_t * nullPointer_fgetws (wchar_t * buffer, int n, FILE* stream)
1268+ {
1269+ // cppcheck-suppress nullPointer
1270+ (void )std::fgetws (NULL ,n,stream);
1271+ // cppcheck-suppress nullPointer
1272+ (void )std::fgetws (buffer,n,NULL );
1273+ // No warning is expected
1274+ return std::fgetws (buffer, n, stream);
1275+ }
1276+
1277+ char * nullPointer_fgets (char *buffer, int n, FILE *stream)
1278+ {
1279+ // cppcheck-suppress nullPointer
1280+ (void )std::fgets (NULL ,n,stream);
1281+ // cppcheck-suppress nullPointer
1282+ (void )std::fgets (buffer,n,NULL );
1283+ // No warning is expected
1284+ return std::fgets (buffer, n, stream);
1285+ }
1286+
12671287void uninitvar_fgets (void )
12681288{
12691289 char *buffer;
You can’t perform that action at this time.
0 commit comments