Just assert early that the page size isn't unreasonable small instead of
corrupting memory later.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2015-06-18 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_begin_elf.c (dwarf_begin_elf): Assert page size is big enough
+ to hold a Dwarf.
+
2015-06-18 Mark Wielaard <mjw@redhat.com>
* dwarf_getpubnames.c (get_offsets): Always free mem on error.
/* Default memory allocation size. */
size_t mem_default_size = sysconf (_SC_PAGESIZE) - 4 * sizeof (void *);
+ assert (sizeof (struct Dwarf) < mem_default_size);
/* Allocate the data structure. */
Dwarf *result = (Dwarf *) calloc (1, sizeof (Dwarf) + mem_default_size);