1 |
vapier 12/04/29 06:24:47 |
2 |
|
3 |
Modified: paxelf.c |
4 |
Log: |
5 |
drop invalid checking when looking up section headers -- e_shentsize applies to the section header struct itself, not the data region that it points to (sh_offset). further, we only care about the sections name here, not the stuff it points to. this fixes a bug where the last section in the ELF which happens to be smaller than e_shentsize cannot be looked up. |
6 |
|
7 |
Revision Changes Path |
8 |
1.72 pax-utils/paxelf.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/paxelf.c?rev=1.72&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/paxelf.c?rev=1.72&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/paxelf.c?r1=1.71&r2=1.72 |
13 |
|
14 |
Index: paxelf.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v |
17 |
retrieving revision 1.71 |
18 |
retrieving revision 1.72 |
19 |
diff -u -r1.71 -r1.72 |
20 |
--- paxelf.c 28 Apr 2012 05:14:26 -0000 1.71 |
21 |
+++ paxelf.c 29 Apr 2012 06:24:47 -0000 1.72 |
22 |
@@ -1,7 +1,7 @@ |
23 |
/* |
24 |
* Copyright 2003-2007 Gentoo Foundation |
25 |
* Distributed under the terms of the GNU General Public License v2 |
26 |
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.71 2012/04/28 05:14:26 vapier Exp $ |
27 |
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.72 2012/04/29 06:24:47 vapier Exp $ |
28 |
* |
29 |
* Copyright 2005-2007 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2007 Mike Frysinger - <vapier@g.o> |
31 |
@@ -706,7 +706,6 @@ |
32 |
if (shstrndx >= shnum) return NULL; \ |
33 |
strtbl = &(shdr[shstrndx]); \ |
34 |
for (i = 0; i < shnum; ++i) { \ |
35 |
- if (EGET(shdr[i].sh_offset) >= elf->len - EGET(ehdr->e_shentsize)) continue; \ |
36 |
offset = EGET(strtbl->sh_offset) + EGET(shdr[i].sh_name); \ |
37 |
if (offset >= (Elf ## B ## _Off)elf->len) continue; \ |
38 |
shdr_name = elf->data + offset; \ |