From 6c7ce3465e2ec0e7cbdc6ea14d8b5f6433cdef63 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 11 Sep 2015 09:25:09 +0200 Subject: [PATCH] pcsx2:CDVD: guarantee that index of mg_zones array is below than 8 CID 146917 (#1 of 1): Untrusted array index read (TAINTED_SCALAR) tainted_data: Using tainted variable cdvd.Result[1] as an index into an array mg_zones --- pcsx2/CDVD/CDVD.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 25317860d3..5fe15ac624 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -1767,7 +1767,7 @@ static void cdvdWrite16(u8 rt) // SCOMMAND cdvdGetMechaVer(&cdvd.Result[1]); cdvdReadRegionParams(&cdvd.Result[3]);//size==8 - DevCon.WriteLn("REGION PARAMS = %s %s", mg_zones[cdvd.Result[1]], &cdvd.Result[3]); + DevCon.WriteLn("REGION PARAMS = %s %s", mg_zones[cdvd.Result[1] & 7], &cdvd.Result[3]); cdvd.Result[1] = 1 << cdvd.Result[1]; //encryption zone; see offset 0x1C in encrypted headers ////////////////////////////////////////// cdvd.Result[2] = 0; //??