diff options
author | Simon Horman <horms@verge.net.au> | 2011-03-03 07:23:52 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-04 09:12:01 +0900 |
commit | 09b390c6925cf038562760608dc7db58b905b5eb (patch) | |
tree | 06780eecc04f0dc33222579f6659146f2abfc3af | |
parent | 13796a24b83f0acd31261eb98c5101ba235870f0 (diff) |
Remove bogus check for too many program headers
This test appears bogus because the e_phnum element of Elf32_Phdr and
is an unsigned 16bit entity.
This addresses the following warnings:
vmcore-dmesg/vmcore-dmesg.c: In function 'read_elf32':
vmcore-dmesg/vmcore-dmesg.c:116: warning: comparison is always false due to limited range of data type
vmcore-dmesg/vmcore-dmesg.c: In function ‘read_elf64’:
vmcore-dmesg/vmcore-dmesg.c:192: warning: comparison is always false due to limited range of data type
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | vmcore-dmesg/vmcore-dmesg.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c index 7015894..365e293 100644 --- a/vmcore-dmesg/vmcore-dmesg.c +++ b/vmcore-dmesg/vmcore-dmesg.c @@ -113,10 +113,6 @@ static void read_elf32(int fd) ehdr.e_phentsize, sizeof(Elf32_Phdr)); exit(12); } - if (ehdr.e_phnum > ULONG_MAX/sizeof(Elf64_Phdr)) { - fprintf(stderr, "Too many elf program header entries\n"); - exit(13); - } phdrs32_size = ehdr.e_phnum * sizeof(Elf32_Phdr); phdrs_size = ehdr.e_phnum * sizeof(Elf64_Phdr); phdr32 = calloc(ehdr.e_phnum, sizeof(Elf32_Phdr)); @@ -189,10 +185,6 @@ static void read_elf64(int fd) ehdr.e_phentsize, sizeof(Elf64_Phdr)); exit(12); } - if (ehdr.e_phnum > ULONG_MAX/sizeof(Elf64_Phdr)) { - fprintf(stderr, "Too many program header entries\n"); - exit(13); - } phdrs_size = ehdr.e_phnum * sizeof(Elf64_Phdr); phdr64 = calloc(ehdr.e_phnum, sizeof(Elf64_Phdr)); if (!phdr64) { |