Skip to content
Commit 35a85550 authored by Shung-Hsi Yu's avatar Shung-Hsi Yu Committed by Andrii Nakryiko
Browse files

libbpf: Deal with section with no data gracefully

ELF section data pointer returned by libelf may be NULL (if section has
SHT_NOBITS), so null check section data pointer before attempting to
copy license and kversion section.

Fixes: cb1e5e96

 ("bpf tools: Collect version and license from ELF sections")
Signed-off-by: default avatarShung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221012022353.7350-3-shung-hsi.yu@suse.com
parent 51deedc9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment