diff options
author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2011-12-19 14:34:00 -0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2011-12-19 15:06:49 -0200 |
commit | fc27344ed970ac11eb09e7f6ab0214f51ca4575b (patch) | |
tree | 4e0236717a26c049b69cc8126bfb1abc48113e5e /libkmod/libkmod-elf.c | |
parent | ab70dce181bc7fa1d29e37912ab64fa784d09092 (diff) | |
download | kmod-fc27344ed970ac11eb09e7f6ab0214f51ca4575b.tar.gz |
elf: fix minimum file size calculation.
there is only a single file header, multiple sections.
Diffstat (limited to 'libkmod/libkmod-elf.c')
-rw-r--r-- | libkmod/libkmod-elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index e1833cf..0cb12ed 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -322,7 +322,7 @@ struct kmod_elf *kmod_elf_new(const void *memory, off_t size) elf->header.section.entry_size, shdr_size); goto invalid; } - min_size = hdr_size * shdr_size * elf->header.section.count; + min_size = hdr_size + shdr_size * elf->header.section.count; if (min_size >= elf->size) { ELFDBG(elf, "file is too short to hold sections\n"); goto invalid; |