Find a file
Erkki Seppälä 502d414118 xcms/cmsProp: don't deal with uninitialized values, fail instead
Properly handle the return value of XGetWindowProperty by considering
if after the loop as well.

Using freed pointer "prop_ret"

There were numerous things wrong in how this function interacted with
XGetWindowProperty.

None of the local variables were initialized and remained that way if
the call to XGetWindowProperty returned 1 (not Succeed). That doesn't
result in after_ret being initialized in which case if it happens to
be 0, the loop was exited. In that case format_ret and nitems_ret were
uninitialized and the function might return with success (but with
uninitialized pointer in prop_ret) or XcmsFailure.

As the buffer enlarging code was called only when XGetWindowProperty
failed (returned not Success), after_ret would not have been
initialized. It would have been initialized only if the
XGetWindowProperty has returned Success earlier, but in that case the
code fragment would not have been reached.

This patch alters the function to return XcmsFailure if the call to
XGetWindowProperty fails.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2011-02-09 22:20:06 -08:00
include Revert "Mark atom names argument to XInternAtoms as const" 2010-12-21 18:51:17 -08:00
m4 Revert “Dolt-ify" 2010-09-13 05:27:41 -04:00
man Revert "Mark atom names argument to XInternAtoms as const" 2010-12-21 18:51:17 -08:00
modules lc/def/lcDefConv: Use Xcalloc to avoid use of uninitialized memory 2011-02-01 23:47:11 -08:00
nls Remove <literal> tags from compose-chart.pl so pdf building doesn't die on soft-hyphens. 2011-01-28 15:32:02 -08:00
specs specs: convert images from gif to svg format. 2010-12-28 17:56:31 -05:00
src xcms/cmsProp: don't deal with uninitialized values, fail instead 2011-02-09 22:20:06 -08:00
.gitignore .gitignore: use common defaults with custom section # 24239 2009-11-14 09:26:16 -05:00
AUTHORS Fix documentation typo 2008-09-08 16:42:48 -04:00
autogen.sh - For now put xtrans in X11/Xtrans/X11, since libX11 is looking for it in <X11/...> 2005-05-13 22:53:36 +00:00
configure.ac config: comment, minor upgrade, quote and layout configure.ac 2011-02-01 13:56:40 -05:00
COPYING Bug 19379 - Provide docs with overview of all compose key combinations 2010-09-21 18:22:21 -07:00
cpprules.in docs: Remove directory prerequisites from make rules 2010-10-10 09:43:55 -07:00
Makefile.am Revert “Dolt-ify" 2010-09-13 05:27:41 -04:00
NEWS Move security fixes to the top of NEWS, and fix spacing. 2007-06-03 21:41:47 -07:00
README Add README with pointers to mailing list, bugzilla & git repos 2009-02-02 20:34:31 -08:00
x11-xcb.pc.in Split public Xlib/XCB functions into libX11-xcb 2006-10-05 17:44:22 -07:00
x11.pc.in Bug 15664: xau & xdmcp not needed in x11.pc dependencies when built with xcb 2009-03-12 17:11:42 -07:00

libX11 - Core X11 protocol client library

Documentation for this library can be found in the included man pages,
the xlib spec from the doc/xorg-docs module, also available at:

	http://xorg.freedesktop.org/releases/X11R7.0/doc/PDF/xlib.pdf

and the O'Reilly Xlib books, which they have made freely available online,
though only for older versions of X11:

 - X Series Volume 2: Xlib Reference Manual (1989, covers X11R3)
	http://www.archive.org/details/xlibretmanver1102nyemiss

 - X Series Volume 2: Xlib Reference Manual, 2nd Edition (1990, covers X11R4)
	http://www.archive.org/details/xlibrefmanv115ed02nyemiss

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/lib/libX11

        http://cgit.freedesktop.org/xorg/lib/libX11

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