vapier 15/02/22 01:38:28 Modified: scanelf.c Log: scanelf: add a few more elf->phdr checks
Revision Changes Path 1.273 pax-utils/scanelf.c file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?rev=1.273&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?rev=1.273&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?r1=1.272&r2=1.273 Index: scanelf.c =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v retrieving revision 1.272 retrieving revision 1.273 diff -u -r1.272 -r1.273 --- scanelf.c 22 Feb 2015 00:54:34 -0000 1.272 +++ scanelf.c 22 Feb 2015 01:38:28 -0000 1.273 @@ -1,13 +1,13 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.272 2015/02/22 00:54:34 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.273 2015/02/22 01:38:28 vapier Exp $ * * Copyright 2003-2012 Ned Ludd - <[email protected]> * Copyright 2004-2012 Mike Frysinger - <[email protected]> */ -static const char rcsid[] = "$Id: scanelf.c,v 1.272 2015/02/22 00:54:34 vapier Exp $"; +static const char rcsid[] = "$Id: scanelf.c,v 1.273 2015/02/22 01:38:28 vapier Exp $"; const char argv0[] = "scanelf"; #include "paxinc.h" @@ -229,6 +229,8 @@ * reconstruct the section header info out of the dynamic * tags so we can see what symbols this guy uses at runtime. */ + if (!elf->phdr) + return; #define GET_SYMTABS_DT(B) \ if (elf->elf_class == ELFCLASS ## B) { \ size_t i; \ @@ -1082,7 +1084,7 @@ } SHOW_INTERP(32) SHOW_INTERP(64) - } else { + } else if (elf->phdr) { /* Walk all the program headers to find the PT_INTERP */ #define SHOW_PT_INTERP(B) \ if (elf->elf_class == ELFCLASS ## B) { \
