From 36ec3954018af14b59c0fd44de7f0e66ac68101e Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 8 Mar 2011 23:24:53 +0100 Subject: [PATCH] dwarflint: Don't let unterminated strings in .debug_str to high-level --- dwarflint/check_debug_info.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index ce245911d..7b936cb91 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -398,6 +398,7 @@ namespace struct coverage *strings_coverage; struct coverage *pc_coverage; bool *need_rangesp; + int *retval_p; }; typedef void (*value_check_cb_t) (uint64_t addr, @@ -451,9 +452,12 @@ namespace while (strp < data_end && *strp != 0) ++strp; if (strp == data_end) - wr_error (*ctx->where) - << "string at .debug_str: " << pri::hex (addr) - << " is not zero-terminated." << std::endl; + { + wr_error (*ctx->where) + << "string at .debug_str: " << pri::hex (addr) + << " is not zero-terminated." << std::endl; + *ctx->retval_p = -2; + } if (ctx->strings_coverage != NULL) ctx->strings_coverage->add (addr, strp - startp + 1); @@ -532,7 +536,8 @@ namespace local_die_refs, strings, strings_coverage, pc_coverage, - need_rangesp + need_rangesp, + &retval }; while (!read_ctx_eof (ctx)) -- 2.47.2