From 77502c6836e4532a73c7d7484bc344030bd4bf71 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 7 May 2025 12:53:08 +0200 Subject: [PATCH] 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 --- dix/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/cursor.c b/dix/cursor.c index f12c50971..8d8bfeb8c 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -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; }