XLibre Xserver
Go to file
Aaron Plattner 8329afa59d dix: Reinstate GetImage window size check
Commit 587c3a2d19 fixed DoGetImage to
check windows against their backing drawables, rather than against the
screen dimensions, to prevent reading outside the bounds of redirected
windows' backing pixmaps (see bug #22804).  Unfortunately, while
making that change I also removed the check that the rectangle is
contained within the bounds of the source window, which is a violation
of the specification:

    If the drawable is a window, the window must be viewable, and it
    must be the case that, if there were no inferiors or overlapping
    windows, the specified rectangle of the window would be fully
    visible on the screen *and wholly contained within the outside
    edges of the window* (or a Match error results). Note that the
    borders of the window can be included and read with this request.

    (emphasis mine)

Reinstate the window dimension check, to return BadMatch if the
GetImage request falls outside the bounds of the window.

Fixes X Test Suite test XGetImage-15:

    400|0 15 1 11:05:41|IC Start
    200|0 15 11:05:41|TP Start
    520|0 15 00005146 1 1|VSW5TESTSUITE PURPOSE 15
    520|0 15 00005146 1 2|Assertion XGetImage-15.(A)
    520|0 15 00005146 1 3|When the drawable is a window and the window is viewable
    520|0 15 00005146 1 4|and it is not the case that given there were no inferiors or
    520|0 15 00005146 1 5|overlapping windows the specified rectangle of the window
    520|0 15 00005146 1 6|would be fully visible on the screen and wholly contained
    520|0 15 00005146 1 7|within the outside edges of the window, then a BadMatch
    520|0 15 00005146 1 8|error occurs.
    520|0 15 00005146 1 9|METH: Create window which is not fully visible on the screen.
    520|0 15 00005146 1 10|METH: Call XMapWindow to make sure the window is viewable.
    520|0 15 00005146 1 11|METH: Call XGetImage with rectangle extending beyond edge of screen.
    520|0 15 00005146 1 12|METH: Verify XGetImage return value is null.
    520|0 15 00005146 1 13|METH: Verify that BadMatch error occurred.
    520|0 15 00005146 1 14|METH: Create window which is fully visible on the screen.
    520|0 15 00005146 1 15|METH: Call XMapWindow to make sure the window is viewable.
    520|0 15 00005146 1 16|METH: Call XGetImage with rectangle extending beyond edge of window.
    520|0 15 00005146 1 17|METH: Verify XGetImage return value is null.
    520|0 15 00005146 1 18|METH: Verify that BadMatch error occurred.
    520|0 15 00005146 1 19|REPORT: Got Success, Expecting BadMatch
    520|0 15 00005146 1 20|REPORT: Null image not returned.
    220|0 15 1 11:05:41|FAIL

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-31 15:42:11 -07:00
Xext Unconditionally #include <stdint.h> 2011-09-23 16:46:23 -07:00
Xi Use new FP1616/FP3232 conversion functions 2011-10-25 14:06:41 +10:00
composite composite: Update borderClip in compAllocPixmap() 2011-10-19 17:24:23 -07:00
config Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -07:00
damageext Use internal temp variable for swap macros 2011-09-21 17:12:04 -04:00
dbe Unconditionally #include <stdint.h> 2011-09-23 16:46:23 -07:00
dix dix: Reinstate GetImage window size check 2011-10-31 15:42:11 -07:00
doc os: Remove Error() 2011-10-11 21:23:46 -07:00
exa EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy. 2011-08-10 09:30:08 -07:00
fb Fix server crash due to invalid images 2011-10-04 20:18:17 -07:00
glx Remove unnecessary #undefs of [f]abs and old comments 2011-09-21 17:12:04 -04:00
hw Merge remote-tracking branch 'whot/for-keith' 2011-10-30 16:57:58 -07:00
include Fix position _X_EXPORT 2011-10-28 13:10:07 -07:00
m4 Use XORG_STRICT_OPTION from util-macros 1.14 to set -Werror flags 2011-05-27 19:51:05 -07:00
man Merge remote-tracking branch 'hramrach/pull' 2011-10-19 17:33:07 -07:00
mi mieq: Reserve some space in EQ for release and other special events 2011-10-21 00:32:03 -07:00
miext Merge remote-tracking branch 'whot/for-keith' 2011-07-01 15:45:45 -07:00
os Merge remote-tracking branch 'herrb/master' 2011-10-18 07:45:24 -07:00
randr randr: stop clients from deleting immutable output properties 2011-10-18 12:04:47 -07:00
record Use internal temp variable for swap macros 2011-09-21 17:12:04 -04:00
render render: export TriStrip and TriFan to the drivers 2011-10-18 12:04:47 -07:00
test xfree86: fix potential buffer overflow 2011-10-31 09:39:04 +10:00
xfixes Use internal temp variable for swap macros 2011-09-21 17:12:04 -04:00
xkb xkb: Support noLock and noUnlock flags for LockMods 2011-10-25 14:06:41 +10:00
.gitignore doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00
COPYING Add asprintf() implementation for platforms without it 2010-12-07 11:10:35 -08:00
Makefile.am man: relocate manual pages in the man subdir outside doc 2011-05-13 14:08:17 -07:00
README packaging: provide a default README file #24206 2010-01-27 14:00:17 -08:00
autogen.sh autogen.sh: Pass --force to autoreconf 2008-07-22 16:55:26 +03:00
configure.ac configure.ac: Add -fno-strict-aliasing to CFLAGS 2011-10-21 00:32:03 -07: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: use PKG_CONFIG variable rather than executable name 2010-01-07 12:57:23 -08:00
xorg-server.pc.in xorg-server.pc.in: Remove libpciaccess and pixman-1 from Requires 2011-10-15 21:18:47 -07: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