Message ID | 20200820115830.39394-1-yauheni.kaliuta@redhat.com |
---|---|
State | Superseded |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [v2] bpf: selftests: global_funcs: check err_str before strstr | expand |
diff --git a/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c b/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c index 25b068591e9a..2e80a57e5f9d 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c +++ b/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c @@ -19,7 +19,7 @@ static int libbpf_debug_print(enum libbpf_print_level level, log_buf = va_arg(args, char *); if (!log_buf) goto out; - if (strstr(log_buf, err_str) == 0) + if (err_str != NULL && strstr(log_buf, err_str) == 0) found = true; out: printf(format, log_buf);