[PATCH:libX11 01/22] Fix file leak on malloc error in XlcDL.c:resolve_object()

2013-08-12 Thread Alan Coopersmith
File Leak: Leaked File fp at line 219 of lib/libX11/src/xlibi18n/XlcDL.c in function 'resolve_object'. fp initialized at line 198 with fopen [ This bug was found by the Parfait 1.2.0 bug checking tool. http://labs.oracle.com/pls/apex/f?p=labs:49:P49_PROJECT_ID:13 ] Signed-off-by:

[PATCH:libX11 02/22] lcfile: skip over any null entries in args list

2013-08-12 Thread Alan Coopersmith
Previous code seemed to assume that printf(%s, NULL) would result in a 0-length string, not (null) or similar, but since there's no point looking for files in (null)/filepath..., instead we just skip over NULL entries in search paths when generating file names. In the *DirName() functions, this

[PATCH:libX11 00/22] libX11 cleanup series, v2

2013-08-12 Thread Alan Coopersmith
As always with Xlib, when looking at the code to fix one thing, you end up finding a dozen more things that could be better. This splits and rearranges some of the v1 patches as discussed from Matthieu's reviews, and adds a few more fixes to the end, because I ended up looking at more Xlib code

[PATCH:libX11 03/22] xlibi18n: convert sprintf calls to snprintf

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Matthieu Herrb matthieu.he...@laas.fr --- src/xlibi18n/XlcDL.c |7 +- src/xlibi18n/lcDynamic.c |4 ++-- src/xlibi18n/lcFile.c| 31 +++-- src/xlibi18n/lcGeneric.c | 58

[PATCH:libX11 04/22] ximcp/imRm.c: convert sprintf calls to snprintf

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Matthieu Herrb matthieu.he...@laas.fr --- modules/im/ximcp/imRm.c | 44 ++-- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/modules/im/ximcp/imRm.c

[PATCH:libX11 05/22] omGeneric.c: convert sprintf calls to snprintf

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Matthieu Herrb matthieu.he...@laas.fr --- modules/om/generic/omGeneric.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/om/generic/omGeneric.c

[PATCH:libX11 07/22] lcDB.c: ensure buffer size is updated correctly if realloc fails

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- src/xlibi18n/lcDB.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xlibi18n/lcDB.c b/src/xlibi18n/lcDB.c index 97b22ac..5048122 100644 --- a/src/xlibi18n/lcDB.c +++ b/src/xlibi18n/lcDB.c @@ -210,11

[PATCH:libX11 06/22] Avoid memory leak/corruption if realloc fails in XlcDL.c:resolve_object()

2013-08-12 Thread Alan Coopersmith
Previously, if realloc failed to increase the size, we'd still record that we had allocated the larger size, but the pointer to it would be NULL, causing future calls to be broken, and the previous allocation to be lost/leaked. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com ---

[PATCH:libX11 08/22] Avoid memory leak/corruption if realloc fails in imLcPrs.c:parseline()

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- modules/im/ximcp/imLcPrs.c | 35 +-- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/modules/im/ximcp/imLcPrs.c b/modules/im/ximcp/imLcPrs.c index f3627a0..34cfcad 100644 ---

[PATCH:libX11 09/22] Avoid memory leak/corruption if realloc fails in Xregion.h:MEMCHECK macro

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- include/X11/Xregion.h |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/X11/Xregion.h b/include/X11/Xregion.h index c25d70b..cf10f86 100644 --- a/include/X11/Xregion.h +++ b/include/X11/Xregion.h

[PATCH:libX11 11/22] miRegionOp(): ensure region size is not updated if realloc fails

2013-08-12 Thread Alan Coopersmith
This function performs operations on a region, and when finished, checks to see if it should compact the rectangle list. If the number of rectangles for which memory is allocated in the list is more than twice the number used, it tries to shrink. realloc() should not fail in this case, but if

[PATCH:libX11 12/22] Delete unused XKB_INSURE_SIZE macro from XKBlibint.h

2013-08-12 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Matthieu Herrb matthieu.he...@laas.fr --- src/xkb/XKBlibint.h |6 -- 1 file changed, 6 deletions(-) diff --git a/src/xkb/XKBlibint.h b/src/xkb/XKBlibint.h index 7b41c3b..6c85558 100644 --- a/src/xkb/XKBlibint.h +++

[PATCH:libX11 15/22] Fix const handling in XSetLocaleModifiers

2013-08-12 Thread Alan Coopersmith
Instead of reusing the input parameter to store the output, make a result variable instead, so that there's less const confusion. Fixes gcc warnings: lcWrap.c: In function 'XSetLocaleModifiers': lcWrap.c:87:18: warning: cast discards '__attribute__((const))' qualifier from pointer target type

[PATCH:libX11 13/22] init_om: remove unneeded extra copy of string to local buffer

2013-08-12 Thread Alan Coopersmith
Strings from the supported_charset_list[] were being copied one by one to a stack buffer, and then strdup called on that buffer. Instead, just strdup the original string, without the local copy, and use a more traditional for loop, so it's easier to figure out what the code is doing (cleaning up

[PATCH:libX11 14/22] Constify lc_name argument to _XlcLocaleDirName() _XlcLocaleLibDirName()

2013-08-12 Thread Alan Coopersmith
Makes code considerably less crufty and clears gcc warnings: XlcDL.c: In function '_XlcDynamicLoad': XlcDL.c:384:44: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] XlcDL.c:386:51: warning: cast discards '__attribute__((const))' qualifier from

[PATCH:libX11 16/22] xlibi18n: Fix a bunch of const cast warnings

2013-08-12 Thread Alan Coopersmith
Add const qualifiers to casts where needed, remove other casts that are no longer needed. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- src/xlibi18n/lcCT.c | 10 +- src/xlibi18n/lcPublic.c |3 ++- src/xlibi18n/mbWrap.c | 12 +---

[PATCH:libX11 18/22] xlibi18n: fix argsize argument to _XlcParsePath

2013-08-12 Thread Alan Coopersmith
The array is defined as having NUM_LOCALEDIR entries, so use that instead of hardcoded 256 value (the other two calls already did this). Reported by parfait: Buffer overflow (CWE 120): In pointer dereference of argv[argc] with index argc Pointer size is 64 elements (of 8 bytes each),

[PATCH:libX11 20/22] Don't cast sizeof() results to unsigned when passing to Xmalloc/Xcalloc

2013-08-12 Thread Alan Coopersmith
sizeof() returns size_t, malloc() calloc() expect sizes in size_t, don't strip down to unsigned int and re-expand unnecessarily. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- src/xcms/CCC.c|5 ++--- src/xcms/cmsCmap.c|5 ++--- src/xcms/cmsInt.c |4

[PATCH:libX11 21/22] Remove unnecessary casts of pointers to (char *) in calls to Xfree()

2013-08-12 Thread Alan Coopersmith
Left one cast behind that is necessary to change from const char * to char * in src/xlibi18n/lcCharSet.c. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- modules/im/ximcp/imDefIm.c |4 +-- modules/im/ximcp/imLcIm.c |2 +- modules/im/ximcp/imThaiIm.c |2 +-

[PATCH:libX11 22/22] Remove long unused src/udcInf.c

2013-08-12 Thread Alan Coopersmith
I can find no record of what this file was for. Neither the X11R6.8.2 monolith Imakefile nor any modular release Makefile.am have ever built it and nothing else references it. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- configure.ac|2 - src/Makefile.am |5 -

Re: [PATCH 1/2] dri2: Invalidate DRI2Buffers upon SetWindowPixmap updates

2013-08-12 Thread Chris Wilson
On Sun, Sep 30, 2012 at 08:18:28PM +0100, Chris Wilson wrote: When transitioning to a redirected or unredirected Window, the Composite layer modifies the Window's Pixmap. However, the DRI2Buffer for the Drawable is still pointing to the backing bo of the old Pixmap with the result that

Re: [PATCH 1/2] dri2: Invalidate DRI2Buffers upon SetWindowPixmap updates

2013-08-12 Thread Dave Airlie
On Mon, Aug 12, 2013 at 6:24 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Sun, Sep 30, 2012 at 08:18:28PM +0100, Chris Wilson wrote: When transitioning to a redirected or unredirected Window, the Composite layer modifies the Window's Pixmap. However, the DRI2Buffer for the Drawable is

Stalled patch

2013-08-12 Thread Alexander E. Patrakov
Hello. There is a bug https://bugs.freedesktop.org/show_bug.cgi?id=39949 that has a patch and was nominated to block xserver-1.12 and xserver-1.13. The bug is still open and has a patch that works for me in the case of scaling (not tested with panning). Why isn't that patch applied? --

Re: [PULL 1.14] touch fixes, backported

2013-08-12 Thread Timo Aaltonen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.07.2013 08:27, Peter Hutterer wrote: I admit this is a huge set of patches but it's needed. Mostly prompted by 56578 it fixes a number of things wrong with the touch implementation as shipped in 1.12-1.14, fixing a few race conditions, a few

Re: [PATCH:libX11 17/22] i18n modules: Fix some const cast warnings

2013-08-12 Thread walter harms
Am 12.08.2013 09:04, schrieb Alan Coopersmith: imRm.c: In function '_XimSetICMode': imRm.c:2419:37: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] imRm.c:2420:30: warning: cast discards '__attribute__((const))' qualifier from pointer

Re: [PATCH:libX11 14/22] Constify lc_name argument to _XlcLocaleDirName() _XlcLocaleLibDirName()

2013-08-12 Thread walter harms
Am 12.08.2013 09:04, schrieb Alan Coopersmith: Makes code considerably less crufty and clears gcc warnings: XlcDL.c: In function '_XlcDynamicLoad': XlcDL.c:384:44: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] XlcDL.c:386:51: warning: cast

Re: [PATCH xserver] Fix random hangs handling too-big requests

2013-08-12 Thread Peter Harris
On 2013-08-05 16:20, Aaron Plattner wrote: On 07/15/13 16:44, Peter Harris wrote: If a request is too big, input-ignoreBytes is set. When ignoreBytes is set, the number of bytes got now is artificially set to zero so the rest of the server does not process the partial request. Make sure the

[PATCH] DDX/DPMS: Call dixSaveScreens() also when screen is turned on

2013-08-12 Thread Egbert Eich
DMPS calls dixSaveScreens() when turned off but not when turned on. In most cases this is irrelevant as DPMS is done when a key is hit in which case dixSaveScreens() will be called to unblank anyhow. This isn't the case if we use xset (or the DPMS extension directly) to unblank. Signed-off-by:

[PATCH] DDX/modes: Add a sanity check when using screen sizes from EDID

2013-08-12 Thread Egbert Eich
EDID sometimes lies about screen sizes. Since the screen size is used by clients to determine the DPI a wrong ration will lead to terrible looking fonts. Add a sanity check for the h/v ratio cutting off at 2.4. This would still accept the cinemascope aspect ratio as valid. Also add message

[PATCH] DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()

2013-08-12 Thread Egbert Eich
When enabling/disabling input handlers in xf86VTSwitch() we treat Input- and GeneralHandlers equally. The result is that after a VT switch the masks for EnabledDevices and AllSockets are equal and the distiction between both types is lost. Signed-off-by: Egbert Eich e...@freedesktop.org ---

[PATCH] DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away

2013-08-12 Thread Egbert Eich
A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to crash when xf86SetViewport() which does not check if the hardware is accessible. Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that. Signed-off-by: Egbert Eich e...@freedesktop.org ---

[PATCH] DDX/fbdevhw: Make error message on failed FBIOBLANK less noisy and scarey

2013-08-12 Thread Egbert Eich
Warn only once on repeated occurrences of the same errno when the FBIOBLANK ioctl fails. Change the status of the message from error to info as this is ioctl is not supported for all fbdev drivers. Also give a better description to make the user happier. Signed-off-by: Egbert Eich

[PATCH] xnest: Ignore GetImage() error in xnestGetImage()

2013-08-12 Thread Egbert Eich
From: Radek Doulik r...@novell.com When an Xnest instance is not viable it will crash when a client in that instance calls GetImage. This is because the Xnest server will itself receives a BadMatch error. This patch ignores the error. The application which has requested the image will receive

[PATCH] vgahw: Resurrect disabling of legacy VGA support

2013-08-12 Thread Egbert Eich
DACDelay() used to be defined differently on platforms that don't have legacy VGA support. This distinction was removed with commit 6d9efdce0d06df6b85f0681bea306c0b1e851502 Author: Adam Jackson a...@redhat.com Date: Tue Sep 20 18:12:29 2011 -0400 vgahw: Port to pciaccess IO space

[PATCH] loader: Use RTLD_DEEPBIND if available to prefer local symbols

2013-08-12 Thread Egbert Eich
If there are namespace clashes among different drivers it would be preferrable if each driver used its local symbols. Use the RTLD_DEEPBIND if available to achive this. Signed-off-by: Egbert Eich e...@freedesktop.org --- configure.ac | 2 ++ hw/xfree86/loader/loader.c | 13

[PATCH libXfont] Make serverGeneration unsigned

2013-08-12 Thread Julien Cristau
Makes the definition match other declarations, and xserver's definition. Debian bug#689439 Reported-by: Michael Tautschnig m...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org --- src/util/miscutil.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH libXfont] Make serverGeneration unsigned

2013-08-12 Thread Alan Coopersmith
On 08/12/13 09:40 AM, Julien Cristau wrote: Makes the definition match other declarations, and xserver's definition. Debian bug#689439 Reported-by: Michael Tautschnig m...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com

Re: [PATCH] vgahw: Resurrect disabling of legacy VGA support

2013-08-12 Thread Mark Kettenis
From: Egbert Eich e...@freedesktop.org Date: Mon, 12 Aug 2013 18:24:47 +0200 DACDelay() used to be defined differently on platforms that don't have legacy VGA support. This distinction was removed with commit 6d9efdce0d06df6b85f0681bea306c0b1e851502 Author: Adam Jackson

Re: [PATCH] DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()

2013-08-12 Thread Daniel Stone
Good catch! This actually explains quite a bit ... Reviewed-by: Daniel Stone dan...@fooishbar.org Cheers, Daniel On 12 August 2013 17:20, Egbert Eich e...@freedesktop.org wrote: When enabling/disabling input handlers in xf86VTSwitch() we treat Input- and GeneralHandlers equally. The result is

Re: [PATCH] xnest: Ignore GetImage() error in xnestGetImage()

2013-08-12 Thread Daniel Stone
Hi, This will be a bit too broad, ignoring errors generated before the XGetImage but only posted then. To avoid that, you need to call XSync(dpy, False) before changing the error handler. Cheers, Daniel On 12 August 2013 17:23, Egbert Eich e...@freedesktop.org wrote: From: Radek Doulik

[PULL 1.14] input fixes for 1.14.3

2013-08-12 Thread Peter Hutterer
One grab fix for touch devices, one fix for XI 1 devices that caused spurious jumps because of missing coordinates. And Keith's fix to bring the XIQueryVersion behaviour in check, along with Maarten's fixes to make check. The following changes since commit

Re: [PATCH] DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()

2013-08-12 Thread Peter Hutterer
On Mon, Aug 12, 2013 at 06:20:36PM +0200, Egbert Eich wrote: When enabling/disabling input handlers in xf86VTSwitch() we treat Input- and GeneralHandlers equally. The result is that after a VT switch the masks for EnabledDevices and AllSockets are equal and the distiction between both types is

Re: [PULL 1.14] input fixes for 1.14.3

2013-08-12 Thread Matt Dew
Merged. bc41226..917c11f server-1.14-branch - server-1.14-branch On 08/12/2013 07:13 PM, Peter Hutterer wrote: One grab fix for touch devices, one fix for XI 1 devices that caused spurious jumps because of missing coordinates. And Keith's fix to bring the XIQueryVersion behaviour in

Re: [PULL 1.14] touch fixes, backported

2013-08-12 Thread Matt Dew
On 08/12/2013 02:52 PM, Peter Hutterer wrote: On Mon, Aug 12, 2013 at 02:12:02PM +0300, Timo Aaltonen wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.07.2013 08:27, Peter Hutterer wrote: I admit this is a huge set of patches but it's needed. Mostly prompted by 56578 it fixes a

Re: [PULL 1.14] touch fixes, backported

2013-08-12 Thread Timo Aaltonen
On 13.08.2013 07:20, Matt Dew wrote: On 08/12/2013 02:52 PM, Peter Hutterer wrote: On Mon, Aug 12, 2013 at 02:12:02PM +0300, Timo Aaltonen wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.07.2013 08:27, Peter Hutterer wrote: I admit this is a huge set of patches but it's needed.

Re: [PATCH] vgahw: Resurrect disabling of legacy VGA support

2013-08-12 Thread Egbert Eich
On Mon, Aug 12, 2013 at 08:58:37PM +0200, Mark Kettenis wrote: From: Egbert Eich e...@freedesktop.org Date: Mon, 12 Aug 2013 18:24:47 +0200 DACDelay() used to be defined differently on platforms that don't have legacy VGA support. This distinction was removed with commit

Re: [PATCH] xnest: Ignore GetImage() error in xnestGetImage()

2013-08-12 Thread Egbert Eich
On Mon, Aug 12, 2013 at 09:00:45PM +0100, Daniel Stone wrote: Hi, This will be a bit too broad, ignoring errors generated before the XGetImage but only posted then. To avoid that, you need to call XSync(dpy, False) before changing the error handler. Argh, indeed, you're right. I'll fix and

[PATCH evdev] Write a SYN_REPORT after the last LED

2013-08-12 Thread Peter Hutterer
When writing LED values to the device, append a SYN_REPORT to the list to ensure other clients are updated immediately. Otherwise, the LED events will be queued and not sent to other clients until the next input event arrives. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net ---