+2014-11-13 Mark Wielaard <mjw@redhat.com>
+
+ * elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
+ check.
+
2014-11-08 Mark Wielaard <mjw@redhat.com>
* elf_begin.c (__libelf_next_arhdr_wrlock): Use mempcpy not __mempcpy.
/* First see whether the information in the section header is
valid and it does not ask for too much. Check for unsigned
overflow. */
- if (unlikely (offset + size > elf->maximum_size
- || (offset + size + elf->maximum_size
- < elf->maximum_size)))
+ if (unlikely (offset > elf->maximum_size
+ || elf->maximum_size - offset < size))
{
/* Something is wrong. */
__libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);