]> git.ipfire.org Git - thirdparty/elfutils.git/commit
Guard against 64bit unsigned wrap around in (int) compare functions.
authorMark Wielaard <mjw@redhat.com>
Sat, 13 Dec 2014 23:09:29 +0000 (00:09 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 16 Dec 2014 09:55:45 +0000 (10:55 +0100)
commit4a330f62794abaa3db95a0b447f4c433e4275ce6
tree0ccbc56b76df545b2dc9ff3806c88243ca6dad83
parentf5c340b17478c441d228b0a3f603030f53e9e2a1
Guard against 64bit unsigned wrap around in (int) compare functions.

Dwarf_Adrr and Dwarf_Off are 64-bit unsigned, and comparison functions
used in qsort or tfind return int, it is possible for the difference to
be so large that it wraps around. Make sure to just return -1, 0 or 1
in compare_aranges and compare_cukey.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdw/ChangeLog
libdw/dwarf_getaranges.c
libdwfl/ChangeLog
libdwfl/cu.c