+2015-04-02 Mark Wielaard <mjw@redhat.com>
+
+ * segment.c (insert): Check correct number of lookup_elts.
+
2015-03-31 Mark Wielaard <mjw@redhat.com>
- * core-file.c (core_file_read_eagerly): Special case small images.
+ * core-file.c (core_file_read_eagerly): Special case small images.
2015-01-26 Mark Wielaard <mjw@redhat.com>
/* Manage address space lookup table for libdwfl.
- Copyright (C) 2008, 2009, 2010, 2013 Red Hat, Inc.
+ Copyright (C) 2008, 2009, 2010, 2013, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
insert (Dwfl *dwfl, size_t i, GElf_Addr start, GElf_Addr end, int segndx)
{
bool need_start = (i == 0 || dwfl->lookup_addr[i - 1] != start);
- bool need_end = (i >= dwfl->lookup_elts || dwfl->lookup_addr[i + 1] != end);
+ bool need_end = (i + 1 >= dwfl->lookup_elts
+ || dwfl->lookup_addr[i + 1] != end);
size_t need = need_start + need_end;
if (need == 0)
return false;