From: notaz Date: Sun, 9 Mar 2014 19:19:31 +0000 (+0200) Subject: translate: detect more invalid writes to args X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de041e5bb00202dfd32327aaed9fc09c4ed28b95;p=ia32rtools.git translate: detect more invalid writes to args --- diff --git a/tools/translate.c b/tools/translate.c index 778df52..66f2a50 100644 --- a/tools/translate.c +++ b/tools/translate.c @@ -1496,7 +1496,8 @@ static int stack_frame_access(struct parsed_op *po, // common problem guess_lmod_from_c_type(&tmp_lmod, &g_func_pp->arg[i].type); if (tmp_lmod != OPLM_DWORD - && (unaligned || (!is_src && tmp_lmod < popr->lmod))) + && (unaligned || (!is_src && lmod_bytes(po, tmp_lmod) + < lmod_bytes(po, popr->lmod) + (offset & 3)))) { ferr(po, "bp_arg arg%d/w offset %d and type '%s' is too small\n", i + 1, offset, g_func_pp->arg[i].type.name);