dix: NULL-protect AllocGlyphCursor()

Return error to the client if sourcefont turns out to be NULL for
whatever reason.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-07 12:53:08 +02:00
parent af71108cd3
commit 77502c6836

View File

@ -339,7 +339,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
rc = dixLookupResourceByType((void **) &sourcefont, source, X11_RESTYPE_FONT,
client, DixUseAccess);
if (rc != Success) {
if ((rc != Success) || (!sourcefont)) {
client->errorValue = source;
return rc;
}