xfree86: Allocate sufficienct space for dev2screen array

When the dev2screen is sized to xf86NumDrivers in DoConfigure(),
subsequent code may attempt to write past the end of the array.

Size the dev2screen array to nDevToConfig instead.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Jeff Smith 2018-02-04 23:17:53 -06:00 committed by Adam Jackson
parent 1a24a0ae7b
commit e81031f3fd

View File

@ -702,7 +702,7 @@ DoConfigure(void)
xf86DoConfigurePass1 = FALSE;
dev2screen = xnfcalloc(xf86NumDrivers, sizeof(int));
dev2screen = xnfcalloc(nDevToConfig, sizeof(int));
{
Bool *driverProbed = xnfcalloc(xf86NumDrivers, sizeof(Bool));