Find a file
Peter Hutterer f07fc1461d xkb: fix invalid memory writes in _XkbCopyGeom.
Classic strlen/strcpy mistake of
   foo = malloc(strlen(bar));
   strcpy(foo, bar);

Testcase: valgrind Xephyr :1

==8591== Invalid write of size 1
==8591==    at 0x4A0638F: strcpy (mc_replace_strmem.c:311)
==8591==    by 0x605593: _XkbCopyGeom (xkbUtils.c:1994)
==8591==    by 0x605973: XkbCopyKeymap (xkbUtils.c:2118)
==8591==    by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560)
==8591==    by 0x4472E2: CoreKeyboardProc (devices.c:577)
==8591==    by 0x447162: ActivateDevice (devices.c:530)
==8591==    by 0x4475D6: InitCoreDevices (devices.c:672)
==8591==    by 0x4449EE: main (main.c:254)
==8591==  Address 0x6f96505 is 0 bytes after a block of size 53 alloc'd
==8591==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==8591==    by 0x6054B7: _XkbCopyGeom (xkbUtils.c:1980)
==8591==    by 0x605973: XkbCopyKeymap (xkbUtils.c:2118)
==8591==    by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560)
==8591==    by 0x4472E2: CoreKeyboardProc (devices.c:577)
==8591==    by 0x447162: ActivateDevice (devices.c:530)
==8591==    by 0x4475D6: InitCoreDevices (devices.c:672)
==8591==    by 0x4449EE: main (main.c:254)

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by-and-apologised-for: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7f19a7a6e9)

Conflicts:

	xkb/xkbUtils.c
(cherry picked from commit f85552aa45)

Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-07-05 15:53:27 +01:00
composite Update Sun license notices to current X.Org standard form 2009-12-18 17:12:00 -08:00
config config: don't shutdown the libhal ctx if it failed to initialize (#23213) 2009-08-14 11:01:20 +10:00
damageext input: define server-supported protocol versions in one single file. 2009-09-21 21:47:35 +10:00
dbe dbe: Fix indentation 2009-07-17 14:57:50 -04:00
dix dix: Fix crash in DeliverGrabbedEvents. 2010-04-21 09:31:00 +10:00
doc Xephyr & Xserver man page fixes 2009-07-07 17:36:24 -07:00
exa exa: fix ExaCheckCopyNtoN for exa_classic when source = dest 2010-06-17 15:21:09 +01:00
fb Fix source pictures getting random transforms after 2d6a8f6683. 2010-01-27 14:58:56 -08:00
glx Fix typos in the swap functions 2010-03-25 02:28:23 -07:00
hw xf86: Don't crash when switching modes through RandR without owning the VT. 2010-07-05 15:53:27 +01:00
include dix: make DeviceEvent coordinates signed for Xinerama. #24986 2010-05-15 19:29:19 +02:00
m4 dolt: add Cygwin to supported platforms 2009-10-19 11:18:58 +10:00
mi rootless: Add some sanity checking to miPaintWindow 2010-05-02 20:05:29 -07:00
miext rootless: Remove an unneeded comment 2010-05-02 20:05:23 -07:00
os XQuartz: Fix possible NULL dereference in ListenOnOpenFD 2010-04-15 14:13:22 -07:00
randr Don't double-swap the RandR PropertyNotify event 2010-02-16 11:30:46 +10:00
record Re-enable RECORD extension. 2010-02-23 10:51:13 +10:00
render Fix crash when all glyphs of a given depth are freed, but not all glyphsets 2010-03-24 11:33:00 -04:00
test dix: EventToCore needs to copy the root window too. 2010-04-07 13:39:43 +10:00
Xext Xext: only update the sprite on pointer events. 2010-05-04 10:54:38 +10:00
xfixes Update Sun license notices to current X.Org standard form 2009-12-18 17:12:00 -08:00
Xi Record: Avoid duplicates from replaying frozen events 2010-03-12 14:38:57 +10:00
xkb xkb: fix invalid memory writes in _XkbCopyGeom. 2010-07-05 15:53:27 +01:00
.gitignore Add (ok, fix) support for DTrace under OS X 2009-09-27 23:34:28 -07:00
autogen.sh autogen.sh: Pass --force to autoreconf 2008-07-22 16:55:26 +03:00
configure.ac xserver 1.7.7 2010-05-04 11:12:44 +10:00
COPYING Update Sun license notices to current X.Org standard form 2009-12-18 17:12:00 -08:00
cpprules.in Update xorg.conf man page & sample for changes in Xorg 1.7 2009-09-14 16:03:18 +10:00
Makefile.am Fix 'distcheck' to use host xkb files but install to build dir 2009-10-22 07:53:35 +10:00
shave-libtool.in shave: use CC tag variable on libtool 2009-09-13 16:43:42 +10:00
shave.in shave: hack around the configure ld check for make distcheck. 2009-09-04 16:41:47 +10:00
xorg-server.m4 macros: use PKG_CONFIG variable rather than executable name 2010-01-19 17:35:55 +13:00
xorg-server.pc.in Since font modules are dead, don't mention them in xorg-server.pc 2009-07-09 17:21:07 -04:00