In mixed core notes, don't let handle_core_item repeat.
authorPetr Machata <pmachata@redhat.com>
Wed, 19 Sep 2012 14:52:07 +0000 (16:52 +0200)
committerPetr Machata <pmachata@redhat.com>
Mon, 24 Sep 2012 23:37:29 +0000 (01:37 +0200)
commit70f5da6cd480615718665e18f6d55c6d1caab1d5
tree6ea65c77e573c3d1c22d4474cce0485672beac3c
parent4a97fd95996d54c1b39c0ab56ecfa8b1dcaeb615
In mixed core notes, don't let handle_core_item repeat.

If a core note contains both registers and items, descsz is 0 to express
that we don't wish to repeat the items.  If there is only one item in
such note, a special block of code hits that passes &size to
handle_core_item, which will decrease that size by the amount consumed by
the item.  But because size is 0, it underflows and wraps, and the loop
following this block, which handles the common case, overruns the core
note buffer.

Signed-off-by: Petr Machata <pmachata@redhat.com>
src/readelf.c