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
This commit is contained in:
Gregory Hainaut 2015-09-11 09:25:09 +02:00
parent 8928c3e7f1
commit 6c7ce3465e
1 changed files with 1 additions and 1 deletions

View File

@ -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; //??