Eric Pouech : dbghelp/dwarf: Detect out of section sibling DIE information.

Alexandre Julliard julliard at winehq.org
Wed Sep 15 16:21:32 CDT 2021


Module: wine
Branch: master
Commit: f0c93974596ac45944c9aef9010f2937fc337148
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f0c93974596ac45944c9aef9010f2937fc337148

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Wed Sep 15 10:38:23 2021 +0200

dbghelp/dwarf: Detect out of section sibling DIE information.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/dwarf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index eb0cfaf2f50..e1702964efa 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1244,6 +1244,12 @@ static BOOL dwarf2_read_one_debug_info(dwarf2_parse_context_t* ctx,
     if (dwarf2_find_attribute(ctx, di, DW_AT_sibling, &sibling) &&
         traverse->data != ctx->module_ctx->sections[ctx->section].address + sibling.u.uvalue)
     {
+        if (sibling.u.uvalue >= ctx->module_ctx->sections[ctx->section].size)
+        {
+            FIXME("cursor sibling after section end %s: 0x%lx 0x%x\n",
+                  dwarf2_debug_ctx(ctx), sibling.u.uvalue, ctx->module_ctx->sections[ctx->section].size);
+            return FALSE;
+        }
         WARN("setting cursor for %s to next sibling <0x%lx>\n",
              dwarf2_debug_traverse_ctx(traverse), sibling.u.uvalue);
         traverse->data = ctx->module_ctx->sections[ctx->section].address + sibling.u.uvalue;




More information about the wine-cvs mailing list