From: Tom Hughes Date: Mon, 22 May 2006 11:15:47 +0000 (+0000) Subject: Validate the fnIdx for a file segment when doing a sanity check. X-Git-Tag: svn/VALGRIND_3_2_0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=593b49c32b6522413aab5d3646a3b61fa8dae915;p=thirdparty%2Fvalgrind.git Validate the fnIdx for a file segment when doing a sanity check. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5919 --- diff --git a/coregrind/m_aspacemgr/aspacemgr.c b/coregrind/m_aspacemgr/aspacemgr.c index 0538fe62ac..5d40fcdba5 100644 --- a/coregrind/m_aspacemgr/aspacemgr.c +++ b/coregrind/m_aspacemgr/aspacemgr.c @@ -932,6 +932,8 @@ static Bool sane_NSegment ( NSegment* s ) case SkFileC: case SkFileV: return s->smode == SmFixed + && (s->fnIdx == -1 || + (s->fnIdx >= 0 && s->fnIdx < segnames_used && segnames[s->fnIdx].inUse)) && !s->isCH; case SkResvn: