/[gentoo-projects]/pax-utils/scanelf.c
Gentoo

Diff of /pax-utils/scanelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.194 Revision 1.195
1/* 1/*
2 * Copyright 2003-2007 Gentoo Foundation 2 * Copyright 2003-2007 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.194 2008/09/29 06:05:55 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.195 2008/10/22 15:20:21 flameeyes Exp $
5 * 5 *
6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char *rcsid = "$Id: scanelf.c,v 1.194 2008/09/29 06:05:55 vapier Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.195 2008/10/22 15:20:21 flameeyes Exp $";
11const char * const argv0 = "scanelf"; 11const char * const argv0 = "scanelf";
12 12
13#include "paxinc.h" 13#include "paxinc.h"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
997 unsigned long cnt = EGET(symtab->sh_entsize); \ 997 unsigned long cnt = EGET(symtab->sh_entsize); \
998 char *symname; \ 998 char *symname; \
999 if (cnt) \ 999 if (cnt) \
1000 cnt = EGET(symtab->sh_size) / cnt; \ 1000 cnt = EGET(symtab->sh_size) / cnt; \
1001 for (i = 0; i < cnt; ++i) { \ 1001 for (i = 0; i < cnt; ++i) { \
1002 if ( (void*)sym > (void*)elf->data_end ) { \
1003 warnf("%s: corrupt ELF symbols - aborting", elf->filename); \
1004 goto break_out; \
1005 } \
1002 if (sym->st_name) { \ 1006 if (sym->st_name) { \
1003 /* make sure the symbol name is in acceptable memory range */ \ 1007 /* make sure the symbol name is in acceptable memory range */ \
1004 symname = (char *)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name)); \ 1008 symname = (char *)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name)); \
1005 if ((void*)symname > (void*)elf->data_end) { \ 1009 if ((void*)symname > (void*)elf->data_end) { \
1006 warnf("%s: corrupt ELF symbols", elf->filename); \ 1010 warnf("%s: corrupt ELF symbols", elf->filename); \

Legend:
Removed from v.1.194  
changed lines
  Added in v.1.195

  ViewVC Help
Powered by ViewVC 1.1.20