+2014-11-14 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (print_debug_frame_section): Sanity Check CIE
+ unit_length and augmentationlen.
+
2014-11-14 Mark Wielaard <mjw@redhat.com>
* readelf.c (handle_versym): Check def == NULL before use.
continue;
}
+ Dwarf_Word maxsize = dataend - readp;
+ if (unlikely (unit_length > maxsize))
+ goto invalid_data;
+
unsigned int ptr_size = ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
ptrdiff_t start = readp - (unsigned char *) data->d_buf;
get_uleb128 (augmentationlen, readp);
if (augmentationlen > (size_t) (dataend - readp))
- error (1, 0, gettext ("invalid augmentation length"));
+ {
+ error (0, 0, gettext ("invalid augmentation length"));
+ readp = cieend;
+ continue;
+ }
const char *hdr = "Augmentation data:";
const char *cp = augmentation + 1;
unsigned int augmentationlen;
get_uleb128 (augmentationlen, readp);
+ if (augmentationlen > (size_t) (dataend - readp))
+ {
+ error (0, 0, gettext ("invalid augmentation length"));
+ readp = cieend;
+ continue;
+ }
+
if (augmentationlen > 0)
{
const char *hdr = "Augmentation data:";