]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Mark the archive header as unusable when there is no next ar element.
authorMark Wielaard <mjw@redhat.com>
Fri, 6 Nov 2009 08:14:09 +0000 (09:14 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 6 Nov 2009 08:14:09 +0000 (09:14 +0100)
libelf/ChangeLog
libelf/elf_next.c

index ba387557c275fe434b432689773ebfd09c374090..974afa1572e72d8828fb4338e53aa76b1abc370b 100644 (file)
@@ -1,3 +1,8 @@
+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.
index fbfb27214d3a131c4962bdec1d35134a436e7615..dddcb5a7ef16d405a89589c38f79b5fb1892c9fb 100644 (file)
@@ -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;