From: Julian Seward Date: Thu, 20 Oct 2011 08:09:39 +0000 (+0000) Subject: Avoid potential overflow in range check. #273431. X-Git-Tag: svn/VALGRIND_3_7_0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcdaa88f60a043cefffdf3d9e8f4e1d49bf075b1;p=thirdparty%2Fvalgrind.git Avoid potential overflow in range check. #273431. (Alexandre Duret-Lutz, adl@gnu.org) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12173 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 106866a86f..284d667996 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -2036,7 +2036,7 @@ UWord evalCfiExpr ( XArray* exprs, Int ix, a = evalCfiExpr( exprs, e->Cex.Deref.ixAddr, eec, ok ); if (!(*ok)) return 0; if (a < eec->min_accessible - || (a + sizeof(UWord) - 1) > eec->max_accessible) { + || a > eec->max_accessible - sizeof(UWord) + 1) { *ok = False; return 0; }