diff options
| author | Mark Wielaard <[email protected]> | 2014-12-16 16:10:28 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2014-12-17 16:48:36 +0100 |
| commit | ff1ce97525529bc4b68d0a48d0ae95a1f67f3779 (patch) | |
| tree | 415f1c84accebafe55ac82845ba7866cc7d394bb /src/readelf.c | |
| parent | 6a8a9e3d275f6eb053ee009ed8038bdffc8ad44b (diff) | |
readelf,libdw: Correct .debug_line overflow check for unit_length.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/readelf.c')
| -rw-r--r-- | src/readelf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/readelf.c b/src/readelf.c index e9a356d1..3c686d5c 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -6357,8 +6357,8 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, } /* 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; |
