On Fri, Aug 9, 2024 at 4:23 AM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote: > > Hello Andrii Nakryiko, > > This is a semi-automatic email about new static checker warnings. > > Commit 8863238993e2 ("selftests/bpf: BPF register range bounds > tester") from Nov 11, 2023, leads to the following Smatch complaint: > > ./tools/testing/selftests/bpf/prog_tests/reg_bounds.c:1121 parse_reg_state() > warn: variable dereferenced before check 'p' (see line 1119) > > ./tools/testing/selftests/bpf/prog_tests/reg_bounds.c > 1118 p = strpbrk(p, ",)"); > 1119 if (*p == ')') > 1120 break; > 1121 if (p) > > Was this NULL check supposed to be checking for the NUL terminator? yeah, looks like a bug, it probably should be `if (p && *p == ')') break;`. Are you planning to send the fix to bpf@xxxxxxxxxxxxxxx? > > 1122 p++; > 1123 } > > regards, > dan carpenter