xserver-multidpi/hw
Alan Coopersmith feebf67463 Limit the number of screens Xvfb will attempt to allocate memory for
Commit f9e3a2955d removing the MAXSCREEN limit left the screen
number too unlimited, and allowed any positive int for a screen number:

Xvfb :1 -screen 2147483647 1024x1024x8

Fatal server error:
Not enough memory for screen 2147483647

Found by Parfait 0.3.7:
Error: Integer overflow (CWE 190)
   Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112
        at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'.

Since the X11 connection setup only has a CARD8 for number of SCREENS,
limit to 255 screens, which is also low enough to avoid overflow on the
sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-02 00:17:28 -08:00
..
dmx dmx: Build fix for -Werror=implicit-function-declaration on linux 2011-11-24 21:15:32 -08:00
kdrive Convert a bunch of sprintf to snprintf calls 2011-11-23 12:15:06 -08:00
vfb Limit the number of screens Xvfb will attempt to allocate memory for 2011-12-02 00:17:28 -08:00
xfree86 Remove another if (E != NULL) check around free(E) 2011-12-01 14:24:54 +00:00
xnest Xnest: Match the host's keymap 2011-10-21 10:29:51 -07:00
xquartz Convert strncpy/strncat to strlcpy/strlcat 2011-11-23 12:15:05 -08:00
xwin Correctly free config file names 2011-11-24 17:47:37 -02:00
Makefile.am Catch errors in recursive relink targets 2010-03-22 00:45:57 -05:00