diff options
| author | Björn Töpel <[email protected]> | 2025-03-18 08:16:47 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2025-03-20 17:35:07 +0000 |
| commit | e16e64f9e076635df554f46e3ecdfbdd2f3867b2 (patch) | |
| tree | 89c296c6e84540cd96cb746f50295ad5aaabedfb /tools/lib/bpf/str_error.h | |
| parent | Merge branch 'selftests-bpf-migrate-test_xdp_vlan-sh-into-test_progs' (diff) | |
| download | kernel-e16e64f9e076635df554f46e3ecdfbdd2f3867b2.tar.gz kernel-e16e64f9e076635df554f46e3ecdfbdd2f3867b2.zip | |
selftests/bpf: Sanitize pointer prior fclose()
There are scenarios where env.{sub,}test_state->stdout_saved, can be
NULL, e.g. sometimes when the watchdog timeout kicks in, or if the
open_memstream syscall is not available.
Avoid crashing test_progs by adding an explicit NULL check prior the
fclose() call.
Signed-off-by: Björn Töpel <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/str_error.h')
0 files changed, 0 insertions, 0 deletions
