summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-07 23:40:12 +0100
committerMark Wielaard <[email protected]>2014-12-11 15:17:31 +0100
commitf0c5ef85bbea093af42c2b95a1f349ebef63de0d (patch)
tree2e2ad2220ad2d964012401e5348caf541ba2b27f /src/readelf.c
parent96ddcad5b6a77c3ecb309cfe77558a01c1734c41 (diff)
readelf: maximum operations per instruction cannot be zero in .debug_line.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/readelf.c b/src/readelf.c
index 881bb45d..fa9ede1d 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6506,6 +6506,14 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
op_index = (op_index + op_advance) % max_ops_per_instr;
}
+ if (max_ops_per_instr == 0)
+ {
+ error (0, 0,
+ gettext ("invalid maximum operations per instruction is zero"));
+ linep = lineendp;
+ continue;
+ }
+
while (linep < lineendp)
{
size_t offset = linep - (const unsigned char *) data->d_buf;