summaryrefslogtreecommitdiff
path: root/src/format/dwarf/v2
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-09-24 21:18:51 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-09-24 21:18:51 (GMT)
commit3c970a0a1b74a1991be303132221329f3eef0b91 (patch)
tree7f3c9e8969f5c5c9fe1188c762dda0668c6f9ff6 /src/format/dwarf/v2
parent65a4b8d9c1929fb7b171d630d336519fc4d418ef (diff)
Prevented out of bounds access when moving the reading position forwards.
Diffstat (limited to 'src/format/dwarf/v2')
-rw-r--r--src/format/dwarf/v2/form.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/format/dwarf/v2/form.c b/src/format/dwarf/v2/form.c
index 8a16887..383bb25 100644
--- a/src/format/dwarf/v2/form.c
+++ b/src/format/dwarf/v2/form.c
@@ -197,7 +197,11 @@ bool read_dwarf_v2_form_value(const GDwarfFormat *format, const dw_compil_unit_h
if (result)
{
copy_vmpa(&iter, get_mrange_addr(&range));
- advance_vmpa(&iter, offset);
+
+ result = g_binary_content_seek(content, &iter, offset);
+
+ if (!result)
+ break;
tmp = g_binary_content_get_raw_access(content, &iter, 1);
result = (tmp != NULL);