+2009-11-06 Mark Wielaard <mjw@redhat.com>
+
+ * elf_next.c (elf_next): Mark the archive header as unusable when
+ there is no next ar element.
+
2009-08-12 Mark Wielaard <mjw@redhat.com>
* Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
/* 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;