projects
/
platform
/
upstream
/
kmod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aac5f45
)
libkmod: use helper function to check for overflow
author
Lucas De Marchi
<lucas.demarchi@intel.com>
Tue, 10 Feb 2015 12:46:26 +0000
(10:46 -0200)
committer
Lucas De Marchi
<lucas.demarchi@intel.com>
Tue, 10 Feb 2015 12:46:26 +0000
(10:46 -0200)
libkmod/libkmod-elf.c
patch
|
blob
|
history
diff --git
a/libkmod/libkmod-elf.c
b/libkmod/libkmod-elf.c
index
8a8a73d
..
4af829e
100644
(file)
--- a/
libkmod/libkmod-elf.c
+++ b/
libkmod/libkmod-elf.c
@@
-250,8
+250,8
@@
static inline int elf_get_section_info(const struct kmod_elf *elf, uint16_t idx,
}
#undef READV
- min_size = *offset + *size;
-
if (ULLONG_MAX - *offset < *size
|| min_size > elf->size) {
+ if (addu64_overflow(*offset, *size, &min_size)
+
|| min_size > elf->size) {
ELFDBG(elf, "out-of-bounds: %"PRIu64" >= %"PRIu64" (ELF size)\n",
min_size, elf->size);
return -EINVAL;