From b937534868c8d7aec3b6d645bf5fd657bbfccd42 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Wed, 29 May 2013 21:30:20 +0530 Subject: Avoid crashing in LD_DEBUG when program name is unavailable Resolves: #15465 The program name may be unavailable if the user application tampers with argc and argv[]. Some parts of the dynamic linker caters for this while others don't, so this patch consolidates the check and fallback into a single macro and updates all users. --- elf/dl-conflict.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'elf/dl-conflict.c') diff --git a/elf/dl-conflict.c b/elf/dl-conflict.c index d63086d99c..11e3cd8773 100644 --- a/elf/dl-conflict.c +++ b/elf/dl-conflict.c @@ -33,8 +33,7 @@ _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict, { #if ! ELF_MACHINE_NO_RELA if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0)) - _dl_debug_printf ("\nconflict processing: %s\n", - l->l_name[0] ? l->l_name : rtld_progname); + _dl_debug_printf ("\nconflict processing: %s\n", DSO_FILENAME (l->l_name)); { /* Do the conflict relocation of the object and library GOT and other -- cgit 1.4.1