+2014-11-14 Mark Wielaard <mjw@redhat.com>
+
+ * gelf_getnote.c (gelf_getnote): Check offset overflow.
+
2014-11-13 Mark Wielaard <mjw@redhat.com>
* elf_getdata.c (__libelf_set_rawdata_wrlock): Fix unsigned overflow
/* Get note information at the supplied offset.
- Copyright (C) 2007 Red Hat, Inc.
+ Copyright (C) 2007, 2014 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
/* The data is already in the correct form. Just make sure the
offset is OK. */
- if (unlikely (offset + sizeof (GElf_Nhdr) > data->d_size))
+ if (unlikely (offset > data->d_size
+ || data->d_size - offset < sizeof (GElf_Nhdr)))
{
__libelf_seterrno (ELF_E_OFFSET_RANGE);
offset = 0;