Adam Jackson <[email protected]> writes:

>
> I beg your pardon?
>
>     if (!dixRegisterPrivateKey
>         (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
>         return;
>
> Client privates aren't pre-zeroed? I was pretty sure they were.

Nope:

...
    clients[i] = client =
        dixAllocateObjectWithPrivates(ClientRec, PRIVATE_CLIENT);
...
#define dixAllocateObjectWithPrivates(t, type) (t *) 
_dixAllocateObjectWithPrivates(sizeof(t), sizeof(t), offsetof(t, devPrivates), 
type)
...
void *
_dixAllocateObjectWithPrivates(unsigned baseSize, unsigned clear,
                               unsigned offset, DevPrivateType type)
...
    object = malloc(totalSize);
    if (!object)
        return NULL;

    memset(object, '\0', clear);

I could easily be convinced that this is a bug and that
_dixAllocateObjectWithPrivates should clear the entire object and
privates out, as I was also surprised to see this.

The only "weird" user of this stuff is colormaps, which allocates the
colormap storage with the base object, to which privates are appended; I
don't think that's relevant.

-- 
-keith

Attachment: signature.asc
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to