From: wessels <> Date: Wed, 25 Feb 1998 04:43:45 +0000 (+0000) Subject: bounds bug X-Git-Tag: SQUID_3_0_PRE1~4004 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8d264b8feedde0e14a5d4b294ac6b55e6aea898;p=thirdparty%2Fsquid.git bounds bug --- diff --git a/src/stat.cc b/src/stat.cc index 2b763b0032..70a276633d 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.204 1998/02/24 21:17:08 wessels Exp $ + * $Id: stat.cc,v 1.205 1998/02/24 21:43:45 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -894,7 +894,9 @@ get_median_svc(int interval, int which) StatCounters *f; StatCounters *l; double x; - + assert(interval > 0); + if (interval > N_COUNT_HIST - 1) + interval = N_COUNT_HIST - 1; f = &CountHist[0]; l = &CountHist[interval]; assert(f);