id
stringlengths
8
32
source_file
stringclasses
51 values
original_function_name
stringlengths
2
66
anonymized_function_name
stringlengths
2
62
function_code
stringlengths
15
623
context
listlengths
0
12
has_bug
bool
2 classes
bug_types
listlengths
0
3
bug_line_offsets
listlengths
0
3
bug_absolute_lines
listlengths
0
3
bug_severities
listlengths
0
3
bug_traces
listlengths
0
3
category
stringclasses
7 values
requires_interprocedural
bool
2 classes
start_line
int32
8
932
end_line
int32
8
936
fopen_015
pulse/fopen.c
fopen_check_fseek_ok
fopen_check_fseek
void fopen_check_fseek() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { fseek(f, 7, SEEK_SET); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
138
146
fopen_016
pulse/fopen.c
no_fopen_check_ftell_bad
no_fopen_check_ftell
void no_fopen_check_ftell() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); ftell(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 152 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
148
154
fopen_017
pulse/fopen.c
fopen_check_ftell_ok
fopen_check_ftell
void fopen_check_ftell() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { ftell(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
156
164
fopen_018
pulse/fopen.c
no_fopen_check_fgets_bad
no_fopen_check_fgets
void no_fopen_check_fgets() { FILE* f; char str[60]; f = fopen("this_file_doesnt_exist", "r"); fgets(str, 60, f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 5 ]
[ 171 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
166
173
fopen_019
pulse/fopen.c
fopen_check_fgets_ok
fopen_check_fgets
void fopen_check_fgets() { FILE* f; char str[60]; f = fopen("this_file_doesnt_exist", "r"); if (f) { fgets(str, 60, f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
175
184
fopen_020
pulse/fopen.c
no_fopen_check_rewind_bad
no_fopen_check_rewind
void no_fopen_check_rewind() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); rewind(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 190 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
186
192
fopen_021
pulse/fopen.c
fopen_check_rewind_ok
fopen_check_rewind
void fopen_check_rewind() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { rewind(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
194
202
fopen_022
pulse/fopen.c
no_fopen_check_fileno_bad
no_fopen_check_fileno
void no_fopen_check_fileno() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); fileno(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 208 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
204
210
fopen_023
pulse/fopen.c
fopen_check_fileno_ok
fopen_check_fileno
void fopen_check_fileno() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { fileno(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
212
220
fopen_024
pulse/fopen.c
no_fopen_check_clearerr_bad
no_fopen_check_clearerr
void no_fopen_check_clearerr() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); clearerr(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 226 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
222
228
fopen_025
pulse/fopen.c
fopen_check_clearerr_ok
fopen_check_clearerr
void fopen_check_clearerr() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { clearerr(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
230
238
fopen_026
pulse/fopen.c
no_fopen_check_ferror_bad
no_fopen_check_ferror
void no_fopen_check_ferror() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); ferror(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 244 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
240
246
fopen_027
pulse/fopen.c
fopen_check_ferror_ok
fopen_check_ferror
void fopen_check_ferror() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { ferror(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
248
256
fopen_028
pulse/fopen.c
no_fopen_check_feof_bad
no_fopen_check_feof
void no_fopen_check_feof() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); feof(f); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 262 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
258
264
fopen_029
pulse/fopen.c
fopen_check_feof_ok
fopen_check_feof
void fopen_check_feof() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { feof(f); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
266
274
fopen_030
pulse/fopen.c
no_fopen_check_fprintf_bad
no_fopen_check_fprintf
void no_fopen_check_fprintf() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); fprintf(f, "blablabla\n"); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 280 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
276
282
fopen_031
pulse/fopen.c
fopen_check_fprintf_ok
fopen_check_fprintf
void fopen_check_fprintf() { FILE* f; f = fopen("this_file_doesnt_exist", "r"); if (f) { fprintf(f, "blablabla\n"); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
284
292
fopen_032
pulse/fopen.c
no_fopen_check_vfprintf_bad
no_fopen_check_vfprintf
void no_fopen_check_vfprintf() { FILE* f; va_list arg; f = fopen("this_file_doesnt_exist", "r"); vfprintf(f, "blablabla\n", arg); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
297
304
fopen_033
pulse/fopen.c
fopen_check_vfprintf_ok
fopen_check_vfprintf
void fopen_check_vfprintf() { FILE* f; va_list arg; f = fopen("this_file_doesnt_exist", "r"); if (f) { vfprintf(f, "blablabla\n", arg); fclose(f); } } */
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
306
315
fopen_034
pulse/fopen.c
no_fopen_check_fgetpos_bad
no_fopen_check_fgetpos
void no_fopen_check_fgetpos() { FILE* f; fpos_t position; f = fopen("this_file_doesnt_exist", "r"); fgetpos(f, &position); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 5 ]
[ 322 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
317
324
fopen_035
pulse/fopen.c
fopen_check_fgetpos_ok
fopen_check_fgetpos
void fopen_check_fgetpos() { FILE* f; fpos_t position; f = fopen("this_file_doesnt_exist", "r"); if (f) { fgetpos(f, &position); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
326
335
fopen_036
pulse/fopen.c
no_fopen_check_fsetpos_bad
no_fopen_check_fsetpos
void no_fopen_check_fsetpos() { FILE* f; fpos_t position; f = fopen("this_file_doesnt_exist", "r"); fsetpos(f, &position); fclose(f); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 5 ]
[ 342 ]
[ "ERROR" ]
[ "in call to `fopen` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
337
344
fopen_037
pulse/fopen.c
fopen_check_fsetpos_ok
fopen_check_fsetpos
void fopen_check_fsetpos() { FILE* f; fpos_t position; f = fopen("this_file_doesnt_exist", "r"); if (f) { fsetpos(f, &position); fclose(f); } }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
346
355
fopen_038
pulse/fopen.c
file_operations_propagate_taint_bad
file_operations_propagate_taint
void file_operations_propagate_taint() { char* tainted = string_source(); FILE* file = fopen(tainted, "r"); if (!file) { return; } char s[256]; char* t = fgets(s, 256, file); sink_string(t); sink_int(fgetc(file)); sink_int(getc(file)); sink_int(fileno(file)); // benign fclose(file); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "TAINT_ERROR", "TAINT_ERROR", "TAINT_ERROR" ]
[ 8, 9, 10 ]
[ 370, 371, 372 ]
[ "ERROR", "ERROR", "ERROR" ]
[ "source of the taint here: value returned from `string_source` with kind `Simple`,in call to `fopen` (modelled),flows to this sink: value passed as argument `#0` to `sink_string` with kind `Simple`", "source of the taint here: value returned from `string_source` with kind `Simple`,in call to `fopen` (modelled),in call to `fgetc` (modelled),flows to this sink: value passed as argument `#0` to `sink_int` with kind `Simple`", "source of the taint here: value returned from `string_source` with kind `Simple`,in call to `fopen` (modelled),in call to `getc` (modelled),flows to this sink: value passed as argument `#0` to `sink_int` with kind `Simple`" ]
other
false
362
375
fopen_039
pulse/fopen.c
fprintf_propagate_taint_bad
fprintf_propagate_taint
void fprintf_propagate_taint() { char* tainted = string_source(); FILE* file = fopen("some_file", "r"); if (!file) { return; } fprintf(file, "%s", tainted); sink_int(getc(file)); fclose(file); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "TAINT_ERROR", "TAINT_ERROR" ]
[ 6, 7 ]
[ 383, 384 ]
[ "ERROR", "ERROR" ]
[ "source of the taint here: value returned from `string_source` with kind `Simple`,flows to this sink: value passed as argument `#2` to `fprintf` with kind `Simple`", "source of the taint here: value returned from `string_source` with kind `Simple`,in call to `fprintf` (modelled),in call to `getc` (modelled),flows to this sink: value passed as argument `#0` to `sink_int` with kind `Simple`" ]
other
false
377
386
fopen_040
pulse/fopen.c
fputs_propagate_taint_bad
fputs_propagate_taint
void fputs_propagate_taint() { char* tainted = string_source(); FILE* file = fopen("some_file", "r"); if (!file) { return; } fputs(tainted, file); sink_int(getc(file)); fclose(file); }
[ "#include <stdio.h>", "#include <stdlib.h>" ]
true
[ "TAINT_ERROR" ]
[ 7 ]
[ 395 ]
[ "ERROR" ]
[ "source of the taint here: value returned from `string_source` with kind `Simple`,in call to `fputs` (modelled),in call to `getc` (modelled),flows to this sink: value passed as argument `#0` to `sink_int` with kind `Simple`" ]
other
false
388
397
frontend_001
pulse/frontend.c
assign_implicit_cast_ok
assign_implicit_cast
void assign_implicit_cast() { bool* b = (bool*)malloc(sizeof(bool)); uint16_t i = 1; if (b) { *b = true; *b = !i; if (*b) { int* p = 0; *p = 5; } free(b); } }
[ "#include <stdbool.h>", "#include <stdint.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
12
24
frontend_002
pulse/frontend.c
assign_implicit_cast_bad
assign_implicit_cast
void assign_implicit_cast() { bool* b = (bool*)malloc(sizeof(bool)); uint16_t i = 0; if (b) { *b = false; *b = !i; if (*b) { int* p = 0; *p = 5; } free(b); } }
[ "#include <stdbool.h>", "#include <stdint.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 8 ]
[ 34 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
26
38
frontend_003
pulse/frontend.c
assign_paren_ok
assign_paren
void assign_paren() { bool* b = (bool*)malloc(sizeof(bool)); int x = 42, y = 33; if (b) { *b = true; *b = (x == y); if (*b) { int* p = 0; *p = 5; } free(b); } }
[ "#include <stdbool.h>", "#include <stdint.h>", "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
40
52
frontend_004
pulse/frontend.c
assign_paren_bad
assign_paren
void assign_paren() { bool* b = (bool*)malloc(sizeof(bool)); int x = 42, y = 42; if (b) { *b = false; *b = (x == y); if (*b) { int* p = 0; *p = 5; } free(b); } }
[ "#include <stdbool.h>", "#include <stdint.h>", "#include <stdlib.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 8 ]
[ 62 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
54
66
frontend_compound_literal_001
pulse/frontend_compound_literal.c
init_with_compound_literal_npe_bad
init_with_compound_literal_npe
void init_with_compound_literal_npe() { struct point p = (struct point){32, 52}; if (p.x == 32) { int* pointer = NULL; *pointer = 42; } }
[ "#include <stdlib.h>", "struct point {\n int x;\n int y;\n};" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 19 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
15
21
frontend_compound_literal_002
pulse/frontend_compound_literal.c
init_with_compound_literal_npe_good
init_with_compound_literal_npe
void init_with_compound_literal_npe() { struct point p = (struct point){32, 52}; if (p.x == 1) { int* pointer = NULL; *pointer = 42; } }
[ "#include <stdlib.h>", "struct point {\n int x;\n int y;\n};" ]
false
[]
[]
[]
[]
[]
safe
false
23
29
frontend_struct_initlistexpr_001
pulse/frontend_struct_initlistexpr.c
return_5
return_5
int return_5() { return 5; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
15
15
frontend_struct_initlistexpr_002
pulse/frontend_struct_initlistexpr.c
init_Point
init_Point
void init_Point() { struct Point p = {1, return_5() + 3}; }
[ "#include <stdlib.h>", "typedef struct Point {\n int x;\n int y;\n} Point;", "int return_5() { return 5; }\n" ]
false
[]
[]
[]
[]
[]
safe
true
17
17
frontend_struct_initlistexpr_003
pulse/frontend_struct_initlistexpr.c
point_coords_set_correctly_npe_bad
point_coords_set_correctly_npe
int point_coords_set_correctly_npe(Point* p) { *p = (Point){4, 5}; int* pointer = NULL; if (p->x == 4) { return *pointer; } else return 0; }
[ "#include <stdlib.h>", "typedef struct Point {\n int x;\n int y;\n} Point;" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 23 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
19
26
frontend_struct_initlistexpr_004
pulse/frontend_struct_initlistexpr.c
point_coords_set_correctly_npe_good
point_coords_set_correctly_npe
int point_coords_set_correctly_npe(Point* p) { *p = (Point){4, 5}; int* pointer = NULL; if (p->x == 1) { return *pointer; } else return 0; }
[ "#include <stdlib.h>", "typedef struct Point {\n int x;\n int y;\n} Point;" ]
false
[]
[]
[]
[]
[]
safe
false
28
35
frontend_struct_initlistexpr_005
pulse/frontend_struct_initlistexpr.c
field_set_correctly_npe_bad
field_set_correctly_npe
int field_set_correctly_npe() { struct Employee e = {12, 3000.50, 12, 12, 2010}; int* p = NULL; if (e.ssn == 12) { return *p; } else return 0; }
[ "#include <stdlib.h>", "struct Employee {\n int ssn;\n float salary;\n struct date {\n int date;\n int month;\n int year;\n } doj;\n} emp1;" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 4 ]
[ 51 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
47
54
frontend_struct_initlistexpr_006
pulse/frontend_struct_initlistexpr.c
field_set_correctly_npe_good
field_set_correctly_npe
int field_set_correctly_npe() { struct Employee e = {12, 3000.50, 12, 12, 2010}; int* p = NULL; if (e.ssn == 1) { return *p; } else return 0; }
[ "#include <stdlib.h>", "struct Employee {\n int ssn;\n float salary;\n struct date {\n int date;\n int month;\n int year;\n } doj;\n} emp1;" ]
false
[]
[]
[]
[]
[]
safe
false
56
63
frontend_struct_initlistexpr_007
pulse/frontend_struct_initlistexpr.c
implicit_expr_set_correctly_npe_bad
implicit_expr_set_correctly_npe
int implicit_expr_set_correctly_npe() { rect imageDrawRect; imageDrawRect = (rect){.size = 5}; int* p = NULL; if (imageDrawRect.origin.x.a == 0) { return *p; } else return 0; }
[ "#include <stdlib.h>", "typedef struct rect rect;", "struct rect {\n struct dot origin;\n int z;\n int size;\n};", "struct dot {\n struct dotdot x;\n int y;\n};", "struct dotdot {\n int a;\n int b;\n};" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 5 ]
[ 87 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
82
90
frontend_struct_initlistexpr_008
pulse/frontend_struct_initlistexpr.c
implicit_expr_set_correctly_npe_good
implicit_expr_set_correctly_npe
int implicit_expr_set_correctly_npe() { rect imageDrawRect; imageDrawRect = (rect){.size = 5}; int* p = NULL; if (imageDrawRect.origin.x.a == 1) { return *p; } else return 0; }
[ "#include <stdlib.h>", "typedef struct rect rect;", "struct rect {\n struct dot origin;\n int z;\n int size;\n};", "struct dot {\n struct dotdot x;\n int y;\n};", "struct dotdot {\n int a;\n int b;\n};" ]
false
[]
[]
[]
[]
[]
safe
false
92
100
funptr_001
pulse/funptr.c
do_nothing
do_nothing
void do_nothing(int** _ptr) { return; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
9
9
funptr_002
pulse/funptr.c
assign_NULL
assign_NULL
void assign_NULL(int** ptr) { *ptr = NULL; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
11
11
funptr_003
pulse/funptr.c
test_syntactic_specialization_bad
test_syntactic_specialization
void test_syntactic_specialization(int* ptr) { call_call_funptr(&assign_NULL, &ptr); *ptr = 42; // NULL dereference here }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 2 ]
[ 23 ]
[ "ERROR" ]
[ "in call to `call_call_funptr`,in call to `call_funptr`,in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,return from call to `call_funptr`,return from call to `call_call_funptr`,invalid access occurs here" ]
nullptr_dereference
false
21
24
funptr_004
pulse/funptr.c
test_returned_funptr_specialization_bad
test_returned_funptr_specialization
void test_returned_funptr_specialization(int* ptr) { void (*funptr)(int**) = return_funptr(); call_call_funptr(funptr, &ptr); *ptr = 42; // NULL dereference here }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 3 ]
[ 33 ]
[ "ERROR" ]
[ "in call to `call_call_funptr`,in call to `call_funptr`,in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,return from call to `call_funptr`,return from call to `call_call_funptr`,invalid access occurs here" ]
nullptr_dereference
false
30
34
funptr_005
pulse/funptr.c
funptr_if_bad
funptr_if
int funptr_if() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } (*funptr)(&ptr); // Calling funptr assigned in if branch return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 10 ]
[ 48 ]
[ "ERROR" ]
[ "in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,invalid access occurs here" ]
nullptr_dereference
false
38
49
funptr_006
pulse/funptr.c
funptr_if_good
funptr_if
int funptr_if() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &do_nothing; } else { funptr = &assign_NULL; } (*funptr)(&ptr); // Calling funptr assigned in if branch return *ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
51
62
funptr_007
pulse/funptr.c
funptr_else_bad
funptr_else
int funptr_else() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (x) { funptr = &do_nothing; } else { funptr = &assign_NULL; } (*funptr)(&ptr); // Calling funptr assigned in else branch return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 10 ]
[ 74 ]
[ "ERROR" ]
[ "in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,invalid access occurs here" ]
nullptr_dereference
false
64
75
funptr_008
pulse/funptr.c
funptr_else_good
funptr_else
int funptr_else() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } (*funptr)(&ptr); // Calling funptr assigned in else branch return *ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
77
88
funptr_009
pulse/funptr.c
funptr_conditional_call_bad
funptr_conditional_call
int funptr_conditional_call(int x) { int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } (*funptr)(&ptr); return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 9 ]
[ 99 ]
[ "ERROR" ]
[ "in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,invalid access occurs here" ]
nullptr_dereference
false
90
100
funptr_010
pulse/funptr.c
funptr_apply_funptr_with_intptrptr_specialized_bad
funptr_apply_funptr_with_intptrptr_specialized
int funptr_apply_funptr_with_intptrptr_specialized() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } apply_funptr_with_intptrptr(funptr, &ptr); // Calling funptr assigned in if branch return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 11 ]
[ 117 ]
[ "ERROR" ]
[ "in call to `apply_funptr_with_intptrptr`,in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,return from call to `apply_funptr_with_intptrptr`,invalid access occurs here" ]
nullptr_dereference
false
106
118
funptr_011
pulse/funptr.c
funptr_apply_funptr_with_intptrptr_specialized_good
funptr_apply_funptr_with_intptrptr_specialized
int funptr_apply_funptr_with_intptrptr_specialized() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &do_nothing; } else { funptr = &assign_NULL; } apply_funptr_with_intptrptr(funptr, &ptr); // Calling funptr assigned in if branch return *ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
120
132
funptr_012
pulse/funptr.c
dereference_dereference_ptr
dereference_dereference_ptr
void dereference_dereference_ptr(int** ptr) { int x = **ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
145
145
funptr_013
pulse/funptr.c
funptr_apply_funptr_with_intptrptr_and_after_specialized_bad
funptr_apply_funptr_with_intptrptr_and_after_specialized
int funptr_apply_funptr_with_intptrptr_and_after_specialized() { int x = 0; int* ptr = &x; void (*funptr)(int**); void (*after)(int**); if (!x) { funptr = &assign_NULL; after = &dereference_dereference_ptr; } else { funptr = &do_nothing; after = &do_nothing; } apply_funptr_with_intptrptr_and_after( funptr, after, &ptr); // Calling funptr assigned in if branch. NPE when calling after return *ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
147
164
funptr_014
pulse/funptr.c
funptr_apply_funptr_with_intptrptr_and_after_respecialized_bad
funptr_apply_funptr_with_intptrptr_and_after_respecialized
int funptr_apply_funptr_with_intptrptr_and_after_respecialized() { int x = 0; int* ptr = &x; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } apply_funptr_with_intptrptr_and_after( funptr, &dereference_dereference_ptr, &ptr); // Calling funptr assigned in if branch return *ptr; }
[ "#include <stddef.h>" ]
false
[]
[]
[]
[]
[]
safe
false
166
180
funptr_015
pulse/funptr.c
funptr_conditionnaly_apply_funptr_with_intptrptr_unspecialized_bad
funptr_conditionnaly_apply_funptr_with_intptrptr_unspecialized
int funptr_conditionnaly_apply_funptr_with_intptrptr_unspecialized() { int x = 0; int* ptr = NULL; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } conditionnaly_apply_funptr_with_intptrptr( x, &ptr, funptr); // funptr is not called; function is not specialized return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 11 ]
[ 202 ]
[ "ERROR" ]
[ "is assigned to the null pointer,assigned,in call to `conditionnaly_apply_funptr_with_intptrptr`,is assigned to the null pointer,assigned,return from call to `conditionnaly_apply_funptr_with_intptrptr`,invalid access occurs here" ]
nullptr_dereference
false
191
203
funptr_016
pulse/funptr.c
funptr_conditionnaly_apply_funptr_with_intptrptr_specialized_bad
funptr_conditionnaly_apply_funptr_with_intptrptr_specialized
int funptr_conditionnaly_apply_funptr_with_intptrptr_specialized() { int x = 1; int* ptr = NULL; void (*funptr)(int**); if (!x) { funptr = &assign_NULL; } else { funptr = &do_nothing; } conditionnaly_apply_funptr_with_intptrptr( x, &ptr, funptr); // Calling funptr assigned in else branch return *ptr; }
[ "#include <stddef.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 11 ]
[ 216 ]
[ "ERROR" ]
[ "in call to `conditionnaly_apply_funptr_with_intptrptr`,is assigned to the null pointer,assigned,return from call to `conditionnaly_apply_funptr_with_intptrptr`,invalid access occurs here" ]
nullptr_dereference
false
205
217
funptr_017
pulse/funptr.c
apply_callback
apply_callback
void apply_callback(callback_s* callback, int** ptr) { (*callback->f)(ptr); }
[ "#include <stddef.h>", "typedef struct FunPtrCallback {\n void (*f)(int**);\n} callback_s;", "void set_callback(callback_s* callback, void (*f)(int**)) { callback->f = f; }" ]
false
[]
[]
[]
[]
[]
safe
false
226
226
funptr_018
pulse/funptr.c
test_assign_NULL_callback_bad
test_assign_NULL_callback
void test_assign_NULL_callback(int* ptr) { callback_s callback = {.f = &assign_NULL}; apply_callback(&callback, &ptr); *ptr = 42; // NULL dereference here }
[ "#include <stddef.h>", "typedef struct FunPtrCallback {\n void (*f)(int**);\n} callback_s;", "void set_callback(callback_s* callback, void (*f)(int**)) { callback->f = f; }", "void apply_callback(callback_s* callback, int** ptr) { (*callback->f)(ptr); }\n" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 3 ]
[ 231 ]
[ "ERROR" ]
[ "in call to `apply_callback`,in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,return from call to `apply_callback`,invalid access occurs here" ]
nullptr_dereference
true
228
232
funptr_019
pulse/funptr.c
test_do_nothing_callback_good
test_do_nothing_callback
void test_do_nothing_callback(int* ptr) { callback_s callback = {.f = &do_nothing}; apply_callback(&callback, &ptr); *ptr = 42; // latent NULL dereference here }
[ "#include <stddef.h>", "typedef struct FunPtrCallback {\n void (*f)(int**);\n} callback_s;", "void set_callback(callback_s* callback, void (*f)(int**)) { callback->f = f; }", "void apply_callback(callback_s* callback, int** ptr) { (*callback->f)(ptr); }\n" ]
false
[]
[]
[]
[]
[]
safe
true
234
238
funptr_020
pulse/funptr.c
test_update_callback_bad
test_update_callback
void test_update_callback(callback_s* callback, int* ptr) { set_callback(callback, &assign_NULL); apply_callback(callback, &ptr); *ptr = 42; // NULL dereference here }
[ "#include <stddef.h>", "typedef struct FunPtrCallback {\n void (*f)(int**);\n} callback_s;", "void apply_callback(callback_s* callback, int** ptr) { (*callback->f)(ptr); }\n" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 3 ]
[ 243 ]
[ "ERROR" ]
[ "in call to `apply_callback`,in call to `assign_NULL`,is assigned to the null pointer,assigned,return from call to `assign_NULL`,return from call to `apply_callback`,invalid access occurs here" ]
nullptr_dereference
true
240
244
funptr_021
pulse/funptr.c
test_update_callback_good
test_update_callback
void test_update_callback(callback_s* callback, int* ptr) { set_callback(callback, &do_nothing); apply_callback(callback, &ptr); *ptr = 42; // latent NULL dereference here }
[ "#include <stddef.h>", "typedef struct FunPtrCallback {\n void (*f)(int**);\n} callback_s;", "void apply_callback(callback_s* callback, int** ptr) { (*callback->f)(ptr); }\n" ]
false
[]
[]
[]
[]
[]
safe
true
246
250
getcwd_001
pulse/getcwd.c
getcwd_ok
getcwd
char getcwd() { char* cwd = getcwd(NULL, 0); if (cwd != NULL) { char result = cwd[0]; free(cwd); return result; } char buf[BUFFER_SIZE]; cwd = getcwd(&buf, BUFFER_SIZE); if (cwd != NULL) { return cwd[0]; } return 'a'; }
[ "#include <unistd.h>" ]
false
[]
[]
[]
[]
[]
safe
false
11
24
getcwd_002
pulse/getcwd.c
getcwd_no_buf_no_check_bad
getcwd_no_buf_no_check
char getcwd_no_buf_no_check() { char* cwd = getcwd(NULL, 0); char result = cwd[0]; free(cwd); return result; }
[ "#include <unistd.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 2 ]
[ 28 ]
[ "ERROR" ]
[ "in call to `getcwd` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
26
31
getcwd_003
pulse/getcwd.c
getcwd_no_buf_no_free_bad
getcwd_no_buf_no_free
char getcwd_no_buf_no_free() { char* cwd = getcwd(NULL, 0); if (cwd != NULL) { return cwd[0]; } return 'a'; }
[ "#include <unistd.h>" ]
true
[ "MEMORY_LEAK_C" ]
[ 3 ]
[ 36 ]
[ "ERROR" ]
[ "allocation part of the trace starts here,allocated by `malloc` here,memory becomes unreachable here" ]
memory_leak
false
33
39
getcwd_004
pulse/getcwd.c
getcwd_no_check_bad
getcwd_no_check
char getcwd_no_check() { char buf[BUFFER_SIZE]; char* cwd = getcwd(&buf, BUFFER_SIZE); return cwd[0]; }
[ "#include <unistd.h>" ]
true
[ "NULLPTR_DEREFERENCE" ]
[ 3 ]
[ 44 ]
[ "ERROR" ]
[ "in call to `getcwd` (modelled),is assigned to the null pointer,assigned,invalid access occurs here" ]
nullptr_dereference
false
41
45
infinite_001
pulse/infinite.c
empty_function_ok
empty_function
void empty_function() { return; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
9
9
infinite_002
pulse/infinite.c
one_liner_ok
one_liner
void one_liner(int x) { x++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
12
12
infinite_003
pulse/infinite.c
two_liner_ok
two_liner
void two_liner(int x) { x++; return; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
15
18
infinite_004
pulse/infinite.c
simple_goto_bad
simple_goto
void simple_goto(int y) { re: y++; goto re; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 3 ]
[ 23 ]
[ "WARNING" ]
[ "in loop" ]
other
false
20
24
infinite_005
pulse/infinite.c
simple_loop0_ok
simple_loop0
void simple_loop0() { int y = 0; while (y < 100) y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
27
31
infinite_006
pulse/infinite.c
simple_loop0_bad
simple_loop0
void simple_loop0() { int y = 0; int x = 0; while (y < 100) x++; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 3 ]
[ 36 ]
[ "WARNING" ]
[ "in loop" ]
other
false
33
38
infinite_007
pulse/infinite.c
simple_goto_ok
simple_goto
void simple_goto(int y) { y++; goto end; end: return; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
41
46
infinite_008
pulse/infinite.c
entry_point_calling_bad
entry_point_calling
void entry_point_calling() { simple_loop0_bad(); }
[ "#include <stdlib.h>", "void simple_loop0_bad() {\n int y = 0;\n int x = 0;\n while (y < 100)\n x++;\n}\n" ]
true
[ "INFINITE_LOOP" ]
[ 1 ]
[ 49 ]
[ "WARNING" ]
[ "when calling `simple_loop0_bad` here,original issue trace starts here,in loop" ]
other
true
48
50
infinite_009
pulse/infinite.c
conditional_goto0_bad
conditional_goto0
void conditional_goto0(int y) { re: if (y == 100) goto re; else return; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 3 ]
[ 56 ]
[ "WARNING" ]
[ "in loop" ]
other
false
53
59
infinite_010
pulse/infinite.c
conditional_goto0_ok
conditional_goto0
void conditional_goto0(int y) { re: if (y == 100) { y++; goto re; } else return; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
61
68
infinite_011
pulse/infinite.c
fcall
fcall
void fcall(int y) { y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
71
71
infinite_012
pulse/infinite.c
loop_call_bad
loop_call
void loop_call(int y) { while (y == 100) fcall(y); return; }
[ "#include <stdlib.h>", "void fcall(int y) { y++; }\n" ]
true
[ "INFINITE_LOOP" ]
[ 1 ]
[ 74 ]
[ "WARNING" ]
[ "in loop" ]
other
true
73
77
infinite_013
pulse/infinite.c
fcall_by_ref
fcall_by_ref
void fcall_by_ref(int* y) { (*y) = (*y) + 1; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
79
79
infinite_014
pulse/infinite.c
loop_call_ok
loop_call
void loop_call(int y) { while (y == 100) fcall_by_ref(&y); return; }
[ "#include <stdlib.h>", "void fcall_by_ref(int* y) { (*y) = (*y) + 1; }\n" ]
false
[]
[]
[]
[]
[]
safe
true
81
85
infinite_015
pulse/infinite.c
twovars_goto_bad
twovars_goto
void twovars_goto(int y) { int z = y; int x = 0; label: x = 42; goto label; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 5 ]
[ 92 ]
[ "WARNING" ]
[ "in loop" ]
other
false
87
93
infinite_016
pulse/infinite.c
loop_pointer_ok
loop_pointer
void loop_pointer(int* x, int y) { int* z = x; // int y = 1; if (x != &y) while (y < 100) { y++; (*z)--; } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
96
104
infinite_017
pulse/infinite.c
loop_pointer_bad
loop_pointer
void loop_pointer(int* x, int y) { int* z = x; // int y = 1; if (x == &y) while (y < 100) { y++; (*z)--; } }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 4 ]
[ 111 ]
[ "WARNING" ]
[ "in loop" ]
other
false
107
115
infinite_018
pulse/infinite.c
var_goto_ok
var_goto
void var_goto(int y) { int x = 42; goto end; x++; end: return; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
118
124
infinite_019
pulse/infinite.c
loop_conditional_bad
loop_conditional
void loop_conditional(int y) { int x = 0; while (y < 100) if (y < 50) x++; else y++; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 2 ]
[ 129 ]
[ "WARNING" ]
[ "in loop" ]
other
false
127
134
infinite_020
pulse/infinite.c
loop_conditional_ok
loop_conditional
void loop_conditional(int y) { int x = 0; while (y < 100) if (y < 50) { x++; y = 50; } else y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
136
144
infinite_021
pulse/infinite.c
nested_external_bad
nested_external
void nested_external(int y) { int x = 0; while (y < 100) { while (x < 3) { x++; } } }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 2 ]
[ 162 ]
[ "WARNING" ]
[ "in loop" ]
other
false
160
167
infinite_022
pulse/infinite.c
nested_external_ok
nested_external
void nested_external(int y) { int x = 0; while (y < 100) { while (x < 2) { x++; } y++; } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
169
177
infinite_023
pulse/infinite.c
nested_loop_cond_ok
nested_loop_cond
void nested_loop_cond(int y) { int x = 42; while (y < 100) { while (x <= 100) { if (x == 50) x = 60; else x++; } y++; } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
179
190
infinite_024
pulse/infinite.c
simple_loop_bad
simple_loop
void simple_loop(int x) { int y = 1; while (x != 3) y++; }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 2 ]
[ 195 ]
[ "WARNING" ]
[ "in loop" ]
other
false
193
197
infinite_025
pulse/infinite.c
simple_loop_ok
simple_loop
void simple_loop(int x) { int y = 1; while (y != 3) y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
199
203
infinite_026
pulse/infinite.c
loop_alternating_bad
loop_alternating
void loop_alternating(int y, int x) { int turn = 0; while (x < 100) { if (turn) x++; else x--; turn = (turn ? 0 : 1); } }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 2 ]
[ 207 ]
[ "WARNING" ]
[ "in loop" ]
other
false
205
214
infinite_027
pulse/infinite.c
loop_alternating_ok
loop_alternating
void loop_alternating(int y, int x) { int turn = 0; while (x < 100) { if (turn) x++; else x = x + 2; turn = (turn ? 0 : 1); } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
216
225
infinite_028
pulse/infinite.c
inner_loop_bad
inner_loop
void inner_loop(int y, int x) { while (y < 100) { while (x == 0) y++; y++; } }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 2 ]
[ 229 ]
[ "WARNING" ]
[ "in loop" ]
other
false
227
233
infinite_029
pulse/infinite.c
inner_loop_ok
inner_loop
void inner_loop(int y, int x) { while (y < 100) { while (x == 0) { y++; x++; } y++; } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
235
243
infinite_030
pulse/infinite.c
simple_dowhile_ok
simple_dowhile
void simple_dowhile(int y, int x) { do { y++; x++; } while (0); }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
245
250
infinite_031
pulse/infinite.c
simple_dowhile_bad
simple_dowhile
void simple_dowhile(int y, int x) { do { x++; } while (y > 0); }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 1 ]
[ 253 ]
[ "WARNING" ]
[ "in loop" ]
other
false
252
256
infinite_032
pulse/infinite.c
conditional_goto_ok
conditional_goto
int conditional_goto(int x, int y) { re: x++; if (0) { int z1 = x * 2; goto re; return (z1); } else { int z2 = x + y; return z2; } }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
258
269
infinite_033
pulse/infinite.c
conditional_goto_bad
conditional_goto
int conditional_goto(int x, int y) { re: x++; if (y) { int z1 = x * 2; goto re; return (z1); } else { int z2 = x + y; return z2; } }
[ "#include <stdlib.h>" ]
true
[ "INFINITE_LOOP" ]
[ 5 ]
[ 276 ]
[ "WARNING" ]
[ "in loop" ]
other
false
271
282
infinite_034
pulse/infinite.c
loop_with_break_ok
loop_with_break
void loop_with_break(int y) { y = 0; while (y < 100) if (y == 50) break; else y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
303
310
infinite_035
pulse/infinite.c
loop_with_break_var1_ok
loop_with_break_var1
void loop_with_break_var1(int y) { y = 0; while (y < 100) if (y == 50) { y--; break; } else y++; }
[ "#include <stdlib.h>" ]
false
[]
[]
[]
[]
[]
safe
false
313
321