From fbbefc0df9db0b40810504fa33ef0de31b7c5428 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 4 Mar 2012 20:14:01 +0000 Subject: [PATCH] sector.c: fix a possible oob access of a local array. git-svn-id: https://svn.eduke32.com/eduke32@2411 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index ed5f92cc8..30c235706 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2711,7 +2711,8 @@ CHECKINV1: { static const int32_t i[8] = { QUOTE_MEDKIT, QUOTE_STEROIDS, QUOTE_HOLODUKE, QUOTE_JETPACK, QUOTE_NVG, QUOTE_SCUBA, QUOTE_BOOTS, 0 }; - P_DoQuote(i[dainv-1], p); + if (dainv>=1 && dainv<=9) + P_DoQuote(i[dainv-1], p); } } }