summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getsrclines.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-16 16:10:28 +0100
committerMark Wielaard <[email protected]>2014-12-17 16:48:36 +0100
commitff1ce97525529bc4b68d0a48d0ae95a1f67f3779 (patch)
tree415f1c84accebafe55ac82845ba7866cc7d394bb /libdw/dwarf_getsrclines.c
parent6a8a9e3d275f6eb053ee009ed8038bdffc8ad44b (diff)
readelf,libdw: Correct .debug_line overflow check for unit_length.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_getsrclines.c')
-rw-r--r--libdw/dwarf_getsrclines.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index d50a17d5..d4779446 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -113,8 +113,8 @@ read_srclines (Dwarf *dbg,
}
/* Check whether we have enough room in the section. */
- if (unit_length < 2 + length + 5 * 1
- || unlikely (linep + unit_length > lineendp))
+ if (unlikely (unit_length > (size_t) (lineendp - linep)
+ || unit_length < 2 + length + 5 * 1))
goto invalid_data;
lineendp = linep + unit_length;