[PATCH:libXdmcp 3/4] Ensure ARRAYofARRAY8 pointers are initialized to NULL

Mouse mouse at Rodents-Montreal.ORG
Fri Sep 27 22:22:05 PDT 2013


> Use calloc for the array of pointers to ensure pointers are cleared
> out so we don't try to free garbage if XdmcpDisposeARRAYofARRAY8 is
> called before the caller sets them to valid pointers.

C does not promise that all-bits-0 (what calloc produces) gives nil
pointers (what you need here).  Has X.org given up on portability to
systems where all-bits-0 is not a nil pointer?  If not, this is a nasty
bug waiting to happen.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse at rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


More information about the xorg-devel mailing list