dix: Fix undefined memset in dixInitPrivates

When we set these up initially, no subsystems have allocated any
privates yet, so the storage address will be null, and memset(NULL, ...)
is undefined.
This commit is contained in:
Adam Jackson
2019-10-15 11:59:39 -04:00
parent 535f14656a
commit a41d45eedc

View File

@@ -447,7 +447,8 @@ _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type)
if (global_keys[type].offset == 0)
addr = 0;
*privates = addr;
memset(addr, '\0', global_keys[type].offset);
if (addr)
memset(addr, '\0', global_keys[type].offset);
}
/*