Make sure that section is actually large enough to hold a 32 bit value.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/181
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
return (uint64_t)-1;
}
- if (crc > (size - sizeof(uint32_t))) {
+ if (size < sizeof(uint32_t) || crc > (size - sizeof(uint32_t))) {
ELFDBG(elf,
"CRC offset %" PRIu64 " is too big, section %" PRIu16
" size is %" PRIu64 "\n",