From: Julian Seward Date: Mon, 11 Nov 2002 08:36:52 +0000 (+0000) Subject: sort_malloc_shadows: check a loop bound in establishing initial shellsort X-Git-Tag: svn/VALGRIND_1_9_4~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a7bcea085eca2558503514d48afdb4ea39cd003;p=thirdparty%2Fvalgrind.git sort_malloc_shadows: check a loop bound in establishing initial shellsort step size. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1286 --- diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c index 613f8f99b3..6b610a0b9d 100644 --- a/coregrind/vg_memory.c +++ b/coregrind/vg_memory.c @@ -691,7 +691,8 @@ void sort_malloc_shadows ( ShadowChunk** shadows, UInt n_shadows ) ShadowChunk* v; bigN = hi - lo + 1; if (bigN < 2) return; - hp = 0; while (incs[hp] < bigN) hp++; hp--; + hp = 0; while (hp < 14 && incs[hp] < bigN) hp++; hp--; + vg_assert(0 <= hp && hp < 14); for (; hp >= 0; hp--) { h = incs[hp];