XLibre Xserver
Go to file
Alan Coopersmith c1c01e3508 Make xf86ValidateModes actually copy clock range list to screen pointer
Our in-house parfait 1.1 code analysis tool complained that every exit
path from xf86ValidateModes() in hw/xfree86/common/xf86Mode.c leaks the
storeClockRanges allocation made at line 1501 with XNFalloc.

Investigating, it seems that this code to copy the clock range list to
the clockRanges list in the screen pointer is just plain insane, and
according to git, has been since we first imported it from XFree86.

We start at line 1495 by walking the linked list from scrp->clockRanges
until we find the end.  But that was just a diversion, since we've found
the end and immediately forgotten it, and thus at 1499 we know that
storeClockRanges is NULL, but that's not a problem since we're going to
immediately overwrite that value as the first thing in the loop.

So we move on through this loop at 1499, which takes us through the
linked list from the clockRanges variable, and for every entry in
that list allocates a new structure and copies cp to it.  If we've
not filled in the screen's clockRanges pointer yet, we set it to
the first storeClockRanges we copied from cp.   Otherwise, as best
I can tell, we just drop it into memory and let it leak away, as
parfait warned.

And then we hit the loop action, which if we haven't hit the end of
the cp list, advances cp to the next item in the list, and then just
for the fun of it, also sets storeClockRanges to the ->next pointer it
has just copied from cp as well, even though it's going to overwrite
it as the very first instruction in the loop body.

v2: rewritten using nt_list_* macros from Xorg's list.h header

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:30:37 -08:00
Xext Handle failure to create counter in init_system_idle_counter 2013-02-05 18:30:10 -08:00
Xi dix: add resource type to touch listeners 2013-01-09 12:33:36 +10:00
composite Stop leaking overlayWin in PanoramiXCompositeGetOverlayWindow error paths 2013-02-05 18:30:13 -08:00
config config/udev: fix "removing GPU device" format string mistake 2013-01-21 19:41:09 -08:00
damageext Move extension initialisation prototypes into extinit.h 2012-07-09 23:06:41 -07:00
dbe Move extension initialisation prototypes into extinit.h 2012-07-09 23:06:41 -07:00
dix Merge branch 'pointer-emulation-fixes-56558-v2' into for-keith 2013-01-11 14:58:17 +10:00
doc doc: Update documentation about Windows platforms support a bit 2012-10-29 12:21:14 +00:00
exa Fix formatting of address operators 2012-12-05 18:09:48 -06:00
fb Fix formatting of address operators 2012-12-05 18:09:48 -06:00
glx Merge remote-tracking branch 'yselkowitz/master' 2012-12-19 12:22:03 -08:00
hw Make xf86ValidateModes actually copy clock range list to screen pointer 2013-02-05 18:30:37 -08:00
include protocol-versions: Bump minor version of XI 2013-01-23 19:05:31 -08:00
m4 Use XORG_STRICT_OPTION from util-macros 1.14 to set -Werror flags 2011-05-27 19:51:05 -07:00
man Correct description of -displayfd option in man page. 2012-10-11 12:53:57 +01:00
mi mi: Ensure pointer emulating touch events update the sprite 2013-01-09 11:23:06 +10:00
miext miext/damage: Only wrap into the GC ops chain if there's a listener (v3) 2012-09-23 10:47:18 -07:00
os Fix formatting of address operators 2012-12-05 18:09:48 -06:00
randr randr: call RRProviderInit in the proper place. 2012-11-30 07:25:54 -08:00
record Move extension initialisation prototypes into extinit.h 2012-07-09 23:06:41 -07:00
render render: Unwrap early on the animated cursor BlockHandler 2013-01-09 11:23:12 +10:00
test test/xi2: fix compiler warning 2012-12-21 13:04:09 +10:00
xfixes Merge remote-tracking branch 'whot/barriers' 2012-12-19 12:09:31 -08:00
xkb xkb: Do not use base group as an array index. 2013-01-09 11:23:12 +10:00
.gitignore doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00
COPYING Loader: Remove extension initialisation sorting 2012-07-10 00:31:02 -07:00
Makefile.am Add 'install-headers' target in the top-level Makefile 2012-07-09 16:29:04 -07:00
README packaging: provide a default README file #24206 2010-01-27 14:00:17 -08:00
autogen.sh autogen.sh: Honor NOCONFIGURE=1 2012-10-19 13:12:33 +10:00
configure.ac Update to version 1.13.99.901 (1.14 RC1) 2012-12-19 12:47:35 -08:00
devbook.am devbook.am: maintenance update from docbook.am 2011-09-21 14:07:52 -07:00
docbook.am docbook.am: embed css styles inside the HTML HEAD element 2011-09-21 14:07:49 -07:00
fix-miregion Change region implementation names to eliminate the 'mi' prefix 2010-06-05 17:47:32 -07:00
fix-miregion-private Change region implementation names to eliminate the 'mi' prefix 2010-06-05 17:47:32 -07:00
fix-patch-whitespace Rename region macros to eliminate screen argument 2010-06-05 18:59:00 -07:00
fix-region Rename region macros to eliminate screen argument 2010-06-05 18:59:00 -07:00
manpages.am Xdmx.man: Show actual configured XKB defaults instead of old hardcoded values 2011-06-21 17:54:14 -07:00
xorg-server.m4 macros: clarify documentation 2012-11-05 13:24:57 -06:00
xorg-server.pc.in xfree86: link modules against Xorg symbols on Cygwin 2012-04-05 21:57:07 -05:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

					X Server

The X server accepts requests from client applications to create windows,
which are (normally rectangular) "virtual screens" that the client program
can draw into.

Windows are then composed on the actual screen by the X server
(or by a separate composite manager) as directed by the window manager,
which usually communicates with the user via graphical controls such as buttons
and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the
following article:
http://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the
Xorg mailing list:

        http://lists.freedesktop.org/mailman/listinfo/xorg

Please submit bug reports to the Xorg bugzilla:

        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg

The master development code repository can be found at:

        git://anongit.freedesktop.org/git/xorg/xserver

        http://cgit.freedesktop.org/xorg/xserver

For patch submission instructions, see:

	http://www.x.org/wiki/Development/Documentation/SubmittingPatches

For more information on the git code manager, see:

        http://wiki.x.org/wiki/GitPage