[PATCH] dix/resource: bug out if we get 0 type resource added

Keith Packard keithp at keithp.com
Thu Mar 7 18:36:03 PST 2013


Colin Harrison <colin.harrison at virgin.net> writes:

> -    counts[(type & TypeMask) - 1]++;
> +    if ((type & TypeMask) != RT_NONE) counts[(type & TypeMask) - 1]++;
>  }
>
> to avoid xrestop crashing the server...which has got to be a good
> thing?

Ouch. Looks like there really are places in the server storing RT_NONE
resources (dix/dixfont.c).

Is there any reason to keep 'optimizing' this code to not count type 0
objects? Seems like a plausible fix would be to just stop offsetting the
types by one in this array.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130307/77079875/attachment.pgp>


More information about the xorg-devel mailing list