dix: fix fuzzing issue when pScreen is NULL
https://github.com/X11Libre/xserver/issues/115
This commit is contained in:
parent
fea8b78358
commit
3c6b6eeb35
|
@ -1866,6 +1866,9 @@ get_client_resolutions(int *num)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
|
|
||||||
pScreen = screenInfo.screens[0];
|
pScreen = screenInfo.screens[0];
|
||||||
|
if (!pScreen)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
|
res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
|
||||||
/*
|
/*
|
||||||
* XXX - we'll want this as long as bitmap instances are prevalent
|
* XXX - we'll want this as long as bitmap instances are prevalent
|
||||||
|
|
|
@ -87,6 +87,9 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
|
||||||
char2b[1] = (unsigned char) (ch & 0xff);
|
char2b[1] = (unsigned char) (ch & 0xff);
|
||||||
|
|
||||||
pScreen = screenInfo.screens[0];
|
pScreen = screenInfo.screens[0];
|
||||||
|
if (!pScreen)
|
||||||
|
return BadDrawable;
|
||||||
|
|
||||||
pbits = calloc(BitmapBytePad(cm->width), cm->height);
|
pbits = calloc(BitmapBytePad(cm->width), cm->height);
|
||||||
if (!pbits)
|
if (!pbits)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
Loading…
Reference in New Issue