summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-11-18 10:01:48 +0100
committerMark Wielaard <mjw@redhat.com>2014-11-18 10:01:48 +0100
commitd405f93d40810455a53eef92ade3ad3255f17cdb (patch)
treee7433381202dc388911d22d07e0af9bb6530fd16
parent9b5fa6b59461896bb64e339174f8b38562164c2f (diff)
downloadelfutils-d405f93d40810455a53eef92ade3ad3255f17cdb.tar.gz
readelf: Fix sanity check of DW_FORM_block length in print_cfa_program
We were checking the reg nr, not the length of the block. Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r--src/readelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/readelf.c b/src/readelf.c
index c14bfb66..08de7989 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -5025,7 +5025,7 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
get_uleb128 (op2, readp); /* Length of DW_FORM_block. */
printf (" expression r%" PRIu64 " (%s) \n",
op1, regname (op1));
- if ((uint64_t) (endp - readp) < op1)
+ if ((uint64_t) (endp - readp) < op2)
goto invalid;
print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, NULL,
op2, readp);