dix: fix fuzzing issue when pScreen is NULL

https://github.com/X11Libre/xserver/issues/115
This commit is contained in:
Herman Semenov 2025-06-13 12:39:36 +03:00
parent fea8b78358
commit 3c6b6eeb35
No known key found for this signature in database
GPG Key ID: D3AB1D2A4576D55E
2 changed files with 6 additions and 0 deletions

View File

@ -1866,6 +1866,9 @@ get_client_resolutions(int *num)
ScreenPtr pScreen;
pScreen = screenInfo.screens[0];
if (!pScreen)
return NULL;
res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
/*
* XXX - we'll want this as long as bitmap instances are prevalent

View File

@ -87,6 +87,9 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
char2b[1] = (unsigned char) (ch & 0xff);
pScreen = screenInfo.screens[0];
if (!pScreen)
return BadDrawable;
pbits = calloc(BitmapBytePad(cm->width), cm->height);
if (!pbits)
return BadAlloc;