summaryrefslogtreecommitdiff
path: root/libelf/elf_next.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf_next.c')
-rw-r--r--libelf/elf_next.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libelf/elf_next.c b/libelf/elf_next.c
index fbfb2721..dddcb5a7 100644
--- a/libelf/elf_next.c
+++ b/libelf/elf_next.c
@@ -84,6 +84,10 @@ elf_next (elf)
/* Get the next archive header. */
ret = __libelf_next_arhdr_wrlock (parent) != 0 ? ELF_C_NULL : elf->cmd;
+ /* If necessary, mark the archive header as unusable. */
+ if (ret == ELF_C_NULL)
+ parent->state.ar.elf_ar_hdr.ar_name = NULL;
+
rwlock_unlock (parent->lock);
return ret;