xfree86: stick two more checks in for num_valuators < MAX_VALUATORS

This commit is contained in:
Peter Hutterer 2008-02-01 14:24:04 +10:30
parent c68f063be6
commit 10617dc0fb

View File

@ -507,6 +507,12 @@ xf86PostMotionEventP(DeviceIntPtr device,
int index;
int flags = 0;
if (num_valuators > MAX_VALUATORS) {
xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d"
" is greater than MAX_VALUATORS\n", num_valuators);
return;
}
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
@ -644,6 +650,12 @@ xf86PostKeyEvent(DeviceIntPtr device,
"badly south after this message, then xf86PostKeyEvent is "
"broken.\n");
if (num_valuators > MAX_VALUATORS) {
xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d"
" is greater than MAX_VALUATORS\n", num_valuators);
return;
}
if (!xf86Events)
FatalError("Didn't allocate event store\n");