Skip to content

Commit 8cc2e35

Browse files
committed
BUILD: tools: potential null pointer dereference in dl_collect_libs_cb
This patch fixes a warning that can be reproduced with gcc-8.5 on RHEL8 (gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28)). This should fix issue haproxy#3303. Must be backported everywhere 917e82f ("MINOR: debug: copy debug symbols from /usr/lib/debug when present") was backported, which is to branch 3.2 for now. (cherry picked from commit 33041fe) Signed-off-by: William Lallemand <wlallemand@haproxy.com> (cherry picked from commit cd2eaea) Signed-off-by: William Lallemand <wlallemand@haproxy.com>
1 parent 59a56f0 commit 8cc2e35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tools.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6002,6 +6002,9 @@ static int dl_collect_libs_cb(struct dl_phdr_info *info, size_t size, void *data
60026002
/* else it's a VDSO or similar and we're not interested */
60036003
goto leave;
60046004

6005+
if (!fname)
6006+
goto leave;
6007+
60056008
load_file_into_tar(&ctx->storage, &ctx->size, ctx->prefix, fname, NULL, "haproxy-libs-dump");
60066009

60076010
/* try to load equivalent debug symbols for absolute paths */

0 commit comments

Comments
 (0)