Revert "bpf: replace snprintf with asprintf when dealing with long buffers"
This reverts commit c0325b06382cb4f7ebfaf80c29c8800d74666fd9.
It introduces a segfault in bpf_make_custom_path() when custom pinning is used.
This happens because asprintf allocates exactly the space needed to hold a
string in the buffer passed as its first argument, but if this buffer is later
used in strcat() or similar we have a buffer overrun.
As the aim of commit c0325b06382c is simply to fix a compiler warning, it
seems safe and reasonable to revert it.
Fixes: c0325b06382c ("bpf: replace snprintf with asprintf when dealing with long buffers")
Reported-by: Jamal Hadi Salim <firstname.lastname@example.org>
Signed-off-by: Andrea Claudi <email@example.com>
Signed-off-by: Stephen Hemminger <firstname.lastname@example.org>
1 file changed