Skip to content

Commit e2d3bad

Browse files
Add test for #10948
1 parent 10a0cbb commit e2d3bad

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/cfg/std.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ char* nullPointer_fgets(char *buffer, int n, FILE *stream)
287287
return fgets(buffer, n, stream);
288288
}
289289

290+
void nullPointer_fseek(void) { // #10948
291+
FILE *p = fopen("foo", "r");
292+
// cppcheck-suppress nullPointerOutOfResources
293+
fseek(p, 1, SEEK_SET);
294+
// cppcheck-suppress nullPointerOutOfResources
295+
fclose(p);
296+
}
297+
290298
void memleak_aligned_alloc(void)
291299
{
292300
// cppcheck-suppress [unusedAllocatedMemory, unreadVariable, constVariablePointer]

0 commit comments

Comments
 (0)