Find a file
Tobias Stoeckmann b469da1430 Fixed off-by-one writes (CVE-2018-14599).
The functions XGetFontPath, XListExtensions, and XListFonts are
vulnerable to an off-by-one override on malicious server responses.

The server replies consist of chunks consisting of a length byte
followed by actual string, which is not NUL-terminated.

While parsing the response, the length byte is overridden with '\0',
thus the memory area can be used as storage of C strings later on. To
be able to NUL-terminate the last string, the buffer is reserved with
an additional byte of space.

For a boundary check, the variable chend (end of ch) was introduced,
pointing at the end of the buffer which ch initially points to.
Unfortunately there is a difference in handling "the end of ch".

While chend points at the first byte that must not be written to,
the for-loop uses chend as the last byte that can be written to.

Therefore, an off-by-one can occur.

I have refactored the code so chend actually points to the last byte
that can be written to without an out of boundary access. As it is not
possible to achieve "ch + length < chend" and "ch + length + 1 > chend"
with the corrected chend meaning, I removed the inner if-check.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2018-08-21 16:42:29 +02:00
include Xlib.h: Fix macros imitating C functions. 2016-02-03 22:11:38 -08:00
m4 Revert “Dolt-ify" 2010-09-13 05:27:41 -04:00
man XkbOpenDisplay.3: fix typo 2018-06-13 15:46:58 +02:00
modules Use flexible array member instead of fake size. 2018-03-23 14:32:05 +10:00
nls Revert "Compose sequences for rouble sign" 2017-02-14 15:33:29 -05:00
specs Clarify state parameter to XkbSetNamedDeviceIndicator 2017-03-24 15:19:27 -07:00
src Fixed off-by-one writes (CVE-2018-14599). 2018-08-21 16:42:29 +02:00
.gitignore Ignore test-driver (used by newer autoconf). 2015-07-19 23:01:05 +02:00
AUTHORS libX11 1.5.0 2012-06-01 23:37:09 -07:00
autogen.sh autogen: add default patch prefix 2017-01-26 13:52:49 +10:00
configure.ac libX11 1.6.5 2017-02-25 21:54:22 -08:00
COPYING Bug 19379 - Provide docs with overview of all compose key combinations 2010-09-21 18:22:21 -07:00
cpprules.in Restore lost tabs in sed commands 2014-05-23 17:27:10 -07:00
docbook.am docbook.am: embed css styles inside the HTML HEAD element 2011-12-30 17:08:14 -05:00
Makefile.am specs: build compose keys tables in specs/i18n/compose 2011-08-05 12:36:03 -04:00
NEWS Move security fixes to the top of NEWS, and fix spacing. 2007-06-03 21:41:47 -07:00
README Update README to reflect where to find the Xlib specs now 2013-06-03 20:07:05 -07: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,
and in the Xlib spec from the specs subdirectory, also available at:

    http://www.x.org/releases/current/doc/libX11/libX11/libX11.html
    http://www.x.org/releases/current/doc/libX11/libX11/libX11.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