Re: supporting non-rectangular windows

2011-01-31 Thread Prasanta Sadhukhan
Thanks for the pointer. I saw that the example use widget API through XCreateManagedWIdget APIs. Are this required to use the shape extension API to work? I wanted to use the shape API without this if possible. I tried a small example of creating a circular window which will have 2 diagonal line

Pull request for libx11 reviewed static analysis fixes

2011-01-31 Thread Erkki Seppälä
are available in the git repository at: git://gitorious.org/erkkise/libx11-fixes.git fixes-reviewed-1 Erkki Seppälä (4): Using freed pointer e Dereferencing possibly NULL str in call to function memcpy (Deref assumed on the basis of 'nonnull' parameter attribute.) Variable

[PATCH v2 3/3] [libx11] Cannot reach dead statement return NULL;

2011-01-31 Thread Erkki Seppälä
Check for the NULLness of prop-name and prop-value instead of name and value, which was checked earlier anyway. Decided against using strdup due to curious memory allocation functions and the rest of the xkb not using it either. Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi diff --git

[PATCH v2 0/3] Various fixes based on static analysis

2011-01-31 Thread Erkki Seppälä
Here are revised versions of the fixes that got some review comments on the list. Erkki Seppälä (3): Variable map goes out of scope Using uninitialized value p-modifiers Cannot reach dead statement return NULL; modules/im/ximcp/imThaiFlt.c |9 +++-- src/KeyBind.c|

[PATCH v2 2/3] [libx11] Using uninitialized value p-modifiers

2011-01-31 Thread Erkki Seppälä
Small fix by using Xcalloc instead of Xmalloc Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi diff --git a/src/KeyBind.c b/src/KeyBind.c index 6d80a02..ac25ce2 100644 --- a/src/KeyBind.c +++ b/src/KeyBind.c @@ -996,7 +996,7 @@ XRebindKeysym ( tmp = dpy-key_bindings; nb =

[PATCH v2 1/3] [libx11] Variable map goes out of scope

2011-01-31 Thread Erkki Seppälä
Release modifiermap before returning. Reordered code to call XGetModifierMapping after the first return from the function. Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi diff --git a/modules/im/ximcp/imThaiFlt.c b/modules/im/ximcp/imThaiFlt.c index e0b3988..e2b0458 100644 ---

[PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Rami Ylimäki
It's sometimes impossible to know in advance whether an X client is using Xlib from multiple threads or not. For example, there could be some generic X client that acts as a plugin container. Plugins could be loaded to the container at runtime, but the container doesn't know whether the plugins

Re: [PATCH evdev] Add third button emulation.

2011-01-31 Thread Benjamin Tissoires
Hi Peter, Thanks, that seems to be a good feature for touchscreen devices! I've got one problem: on which tree does this patch applies? (I've tried against the branch master of xf86-input-evdev): error: patch failed: src/evdev.c:453 error: src/evdev.c: patch does not apply error: patch

[PATCH 00/25] Various fixes based on static analysis - remaining patches

2011-01-31 Thread Erkki Seppälä
Here are the remaining patches of the libx11 static analysis batch that have not yet received feedback from the list. Next up, pull-request :). Ander Conselvan de Oliveira (6): Double free of pointer property_return in call to free xcms/LRGB: Fix potential resource leak. xcms/LRGB: Add a

[PATCH 03/25] [libx11] Pointer pBuf returned from fgets(buf, 256, stream) is never used

2011-01-31 Thread Erkki Seppälä
Removed unused assignment Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xcms/cmsColNm.c

[PATCH 02/25] [libx11] Pointer pBuf returned from fgets(buf, 256, stream) is never used

2011-01-31 Thread Erkki Seppälä
Removed unused assignment Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xcms/cmsColNm.c

[PATCH 01/25] [libx11] Variable fs not freed or pointed-to in function get_prop_name

2011-01-31 Thread Erkki Seppälä
Fixed a missing call to XFreeFont Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/XDefaultOMIF.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

[PATCH 07/25] [libx11] Variable missing_list goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree and initializing missing_list with NULL Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2 insertions(+), 1

[PATCH 11/25] [libx11] Variable image goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/ImUtil.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/ImUtil.c b/src/ImUtil.c index

[PATCH 05/25] [libx11] Possible overrun of 8192 byte fixed size buffer buffer by copying ext-name without length checking

2011-01-31 Thread Erkki Seppälä
Fixed by using strncpy and explicitly terminating the buffer Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/XlibInt.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH 12/25] [libx11] Variable prop_name not freed or pointed-to in function strlen

2011-01-31 Thread Erkki Seppälä
Instead of copying the value returned by get_prop_name and then releasing it, directly use the return value of get_prop_name, which allocates memory for the name. Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi

[PATCH 08/25] [libx11] Variable colormap_ret goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index ae053c9..5035df5 100644 ---

[PATCH 24/25] [libx11] Cannot reach dead expression 0U inside statement if (1U + (target_dir ? strl...

2011-01-31 Thread Erkki Seppälä
Removed superfluous check for NULL target_dir; it is already handled before this code. Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcFile.c |3 +-- 1 files changed, 1 insertions(+), 2

[PATCH 06/25] [libx11] Variable colormap_ret goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH 22/25] [libx11] Return value of XGetWindowProperty(im-core.display, spec-lib_connect_wid, prop, 0L, (length + bytes_after_ret + 3UL) / 4UL, 1, 0UL, type_ret, format_ret, nitems, bytes_af

2011-01-31 Thread Erkki Seppälä
Checked return value of XGetWindowProperty and return false if it fails. Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imTrX.c | 33 + 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/modules/im/ximcp/imTrX.c

[PATCH 23/25] [libx11] a negative value was passed to memcpy

2011-01-31 Thread Erkki Seppälä
Fixed by checking for the negative return value of _Xlcwctomb and returning 0/XLookupNone in that case. Unfortunately the other return values for *status don't fit into the error (which appears to indicate some internal error or running out of memory). The other valid status codes are

[PATCH 20/25] [libx11] Variable wd_array goes out of scope Value wd_array is overwritten in wd_array = (XPointer*)realloc((char*)info_list-watch_data, (((dpy-watcher_count + 1) * 4U == 0U) ? 1U

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com info_list-watch_data was being reallocated, but the return value of the reallocation was stored only into a local variable. This might cause some funky behavior and crashes. Reviewed-by: Erkki Seppälä

[PATCH 09/25] [libx11] Variable colormap_ret goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/im/ximcp/imRm.c

[PATCH 10/25] [libx11] Variable colormap_ret goes out of scope

2011-01-31 Thread Erkki Seppälä
Fixed memory leak by adding Xfree Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/im/ximcp/imRm.c

[PATCH 21/25] [libx11] Using uninitialized value conv-state in call to function close_converter

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Fixed by zero'ing conv on allocation. Then close_converter works properly. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by:

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Julien Cristau
On Mon, Jan 31, 2011 at 12:46:56 +0200, Rami Ylimäki wrote: This change makes it possible to guard a system against a missing XInitThreads call in X clients. One might argue that this is a client problem and that all X clients should call XInitThreads if it's possible that they could use Xlib

[PATCH 04/25] [libx11] Using uninitialized value new

2011-01-31 Thread Erkki Seppälä
Zero-initialized new Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcGeneric.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xlibi18n/lcGeneric.c

[PATCH 13/25] [libx11] Variable table goes out of scope

2011-01-31 Thread Erkki Seppälä
The NEWTABLE macro missed freeing its allocated memory on subsequent memory allocation errors. Added call to Xfree. Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/Xrm.c |4 +++- 1 files changed, 3

[PATCH 17/25] [libx11] xcms/LRGB: Add a label for freeing property_return.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi

[PATCH 16/25] [libx11] xcms/LRGB: Fix potential resource leak.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com property_return was not free'd if the allocation of pRedTbl failed. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki

[PATCH 14/25] [libx11] Tracked variable size was passed to a negative sink.

2011-01-31 Thread Erkki Seppälä
Fixed the handling of the extremely unlikely situation of fstat failing Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/Xrm.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git

[PATCH 25/25] [libx11] Cannot reach dead expression 0U inside statement if (1U + (target_dir ? strl...

2011-01-31 Thread Erkki Seppälä
Removed superfluous check for NULL target_dir; it is already handled before this code. Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcFile.c |3 +-- 1 files changed, 1 insertions(+), 2

Re: [PATCH 00/25] Various fixes based on static analysis - remaining patches

2011-01-31 Thread Julien Cristau
On Mon, Jan 31, 2011 at 13:07:07 +0200, Erkki Seppälä wrote: Here are the remaining patches of the libx11 static analysis batch that have not yet received feedback from the list. Next up, pull-request :). Can you make the Subject of the patches something understandable? Having the output of

[PATCH 19/25] [libx11] Using freed pointer prop_ret

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com In the case were a first call to XGetWindowProperty succeeds but the initial value of len is smaller than the total length of the property, prop_return is freed and another call XGWP is made. If that subsequent call fails,

[PATCH v2 00/25] Various fixes based on static analysis - remaining patches

2011-01-31 Thread Erkki Seppälä
Here are the remaining patches of the libx11 static analysis batch that have not yet received feedback from the list. This batch has the comments fixed so that the actual change is first, while the diagnosis from the tool follows, thus making git shortlog more useful. Next up, pull-request :).

[PATCH v2 03/25] [libx11] Removed unused assignment

2011-01-31 Thread Erkki Seppälä
Pointer pBuf returned from fgets(buf, 256, stream) is never used Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH v2 02/25] [libx11] Removed unused assignment

2011-01-31 Thread Erkki Seppälä
Pointer pBuf returned from fgets(buf, 256, stream) is never used Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH v2 13/25] [libx11] The NEWTABLE macro missed freeing its allocated memory on subsequent memory allocation errors. Added call to Xfree.

2011-01-31 Thread Erkki Seppälä
Variable table goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/Xrm.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/Xrm.c b/src/Xrm.c index

[PATCH v2 01/25] [libx11] Fixed a missing call to XFreeFont

2011-01-31 Thread Erkki Seppälä
Variable fs not freed or pointed-to in function get_prop_name Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/XDefaultOMIF.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff

[PATCH v2 14/25] [libx11] Fixed the handling of the extremely unlikely situation of fstat failing

2011-01-31 Thread Erkki Seppälä
Tracked variable size was passed to a negative sink. Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/Xrm.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/Xrm.c

[PATCH v2 09/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Erkki Seppälä
Variable colormap_ret goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

[PATCH v2 15/25] [libx11] property_return was free'd before and in the case the conditional is true, the call to XcmsGetProperty failed which means that property_return wasn't set so there is no need

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Double free of pointer property_return in call to free Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä

[PATCH v2 08/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Erkki Seppälä
Variable colormap_ret goes out of scope Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index ae053c9..5035df5 100644 ---

[PATCH v2 11/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Erkki Seppälä
Variable image goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/ImUtil.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/ImUtil.c b/src/ImUtil.c index

[PATCH v2 06/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Erkki Seppälä
Variable colormap_ret goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH v2 05/25] [libx11] Fixed by using strncpy and explicitly terminating the buffer

2011-01-31 Thread Erkki Seppälä
Possible overrun of 8192 byte fixed size buffer buffer by copying ext-name without length checking Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/XlibInt.c |7 --- 1 files changed, 4

[PATCH v2 21/25] [libx11] Fixed by zero'ing conv on allocation. Then close_converter works properly.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Using uninitialized value conv-state in call to function close_converter Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by:

[PATCH v2 18/25] [libx11] Initialize local variable

2011-01-31 Thread Erkki Seppälä
Using uninitialized value error.resourceID in call to function _XError Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/GetProp.c |2 +- 1 files

[PATCH v2 04/25] [libx11] Zero-initialized new

2011-01-31 Thread Erkki Seppälä
Using uninitialized value new Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcGeneric.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xlibi18n/lcGeneric.c

[PATCH v2 20/25] [libx11] info_list-watch_data was being reallocated, but the return value of the reallocation was stored only into a local variable. This might cause some funky behavior and crashes.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Variable wd_array goes out of scope Value wd_array is overwritten in wd_array = (XPointer*)realloc((char*)info_list-watch_data, (((dpy-watcher_count + 1) * 4U == 0U) ? 1U : ((dpy-watcher_count + 1) * 4U))) Reviewed-by:

[PATCH v2 22/25] [libx11] Checked return value of XGetWindowProperty and return false if it fails.

2011-01-31 Thread Erkki Seppälä
Return value of XGetWindowProperty(im-core.display, spec-lib_connect_wid, prop, 0L, (length + bytes_after_ret + 3UL) / 4UL, 1, 0UL, type_ret, format_ret, nitems, bytes_after_ret, prop_ret) is not checked Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imTrX.c | 33

[PATCH v2 17/25] [libx11] The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com xcms/LRGB: Add a label for freeing property_return. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä

[PATCH v2 16/25] [libx11] property_return was not free'd if the allocation of pRedTbl failed.

2011-01-31 Thread Erkki Seppälä
From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com xcms/LRGB: Fix potential resource leak. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä

[PATCH v2 12/25] [libx11] Instead of copying the value returned by get_prop_name and then releasing it, directly use the return value of get_prop_name, which allocates memory for the name.

2011-01-31 Thread Erkki Seppälä
Variable prop_name not freed or pointed-to in function strlen Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/XDefaultOMIF.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff

[PATCH v2 25/25] [libx11] Removed superfluous check for NULL target_dir; it is already handled before this code.

2011-01-31 Thread Erkki Seppälä
Cannot reach dead expression 0U inside statement if (1U + (target_dir ? strl... Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcFile.c |3 +-- 1 files changed, 1 insertions(+), 2

[PATCH v2 24/25] [libx11] Removed superfluous check for NULL target_dir; it is already handled before this code.

2011-01-31 Thread Erkki Seppälä
Cannot reach dead expression 0U inside statement if (1U + (target_dir ? strl... Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcFile.c |3 +-- 1 files changed, 1 insertions(+), 2

[PATCH v2 23/25] [libx11] Fixed by negative value to memcpy by checking for the negative return value of _Xlcwctomb and returning 0/XLookupNone in that case.

2011-01-31 Thread Erkki Seppälä
a negative value was passed to memcpy Unfortunately the other return values for *status don't fit into the error (which appears to indicate some internal error or running out of memory). The other valid status codes are XBufferOverflow, XLookupNone, XLookupChars, XLookupKeySym, and XLookupBoth.

[PATCH v2 07/25] [libx11] Fixed memory leak by adding Xfree and initializing missing_list with NULL

2011-01-31 Thread Erkki Seppälä
Variable missing_list goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Tiago Vignatti
On 01/31/2011 01:13 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 12:46:56 +0200, Rami Ylimäki wrote: This change makes it possible to guard a system against a missing XInitThreads call in X clients. One might argue that this is a client problem and that all X clients should call

[PATCH v2 x11perf 0/3] Window size related modifications.

2011-01-31 Thread Rami Ylimäki
Two changes are introduced: - Ignore and skip a benchmark if XGetImage would generate a BadMatch error. - Allow default test window size to be redefined with extra options. Rami Ylimäki (3): Let window size to be variable instead of constant. Let user to override the default window

[PATCH v2 x11perf 1/3] Let window size to be variable instead of constant.

2011-01-31 Thread Rami Ylimäki
Signed-off-by: Rami Ylimäki rami.ylim...@vincit.fi --- do_arcs.c| 12 ++-- do_blt.c | 36 ++-- do_complex.c |8 do_lines.c | 16 do_movewin.c | 10 +- do_rects.c |4 ++-- do_segs.c| 12

[PATCH v2 x11perf 2/3] Let user to override the default window dimensions.

2011-01-31 Thread Rami Ylimäki
Signed-off-by: Rami Ylimäki rami.ylim...@vincit.fi --- x11perf.c | 19 ++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/x11perf.c b/x11perf.c index 39ab493..29ca1ec 100644 --- a/x11perf.c +++ b/x11perf.c @@ -497,6 +497,8 @@ usage(void) -rop rop0 rop1 ...

[PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.

2011-01-31 Thread Rami Ylimäki
Signed-off-by: Rami Ylimäki rami.ylim...@vincit.fi --- do_blt.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/do_blt.c b/do_blt.c index 4be2836..fae9e1d 100644 --- a/do_blt.c +++ b/do_blt.c @@ -208,6 +208,16 @@ InitCopyPix(XParms xp, Parms p, int reps) int

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Julien Cristau
On Mon, Jan 31, 2011 at 15:12:29 +0200, Tiago Vignatti wrote: On 01/31/2011 01:13 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 12:46:56 +0200, Rami Ylimäki wrote: This change makes it possible to guard a system against a missing XInitThreads call in X clients. One might argue that

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Tiago Vignatti
On 01/31/2011 04:06 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 15:12:29 +0200, Tiago Vignatti wrote: On 01/31/2011 01:13 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 12:46:56 +0200, Rami Ylimäki wrote: This change makes it possible to guard a system against a missing

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Rami Ylimäki
On 01/31/2011 04:14 PM, Tiago Vignatti wrote: On 01/31/2011 04:06 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 15:12:29 +0200, Tiago Vignatti wrote: On 01/31/2011 01:13 PM, ext Julien Cristau wrote: On Mon, Jan 31, 2011 at 12:46:56 +0200, Rami Ylimäki wrote: This change makes it

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Rami Ylimäki
Would it be possible to guard against misbehaving applications by making it possible to configure libX11 with a dummy mutex? typedef int dummy_mutex; void lock(int *m) { assert(++(*m) == 1); }; void unlock(int *m) { *m = 0 }; It's not perfect but I guess it would be better than crashing

Re: supporting non-rectangular windows

2011-01-31 Thread Pat Kane
Add this line just before the event loop: XMapWindow(dsp, win); Pat --- On Mon, Jan 31, 2011 at 2:05 AM, Prasanta Sadhukhan psadhuk...@gmail.com wrote: Thanks for the pointer. I saw that the example use widget API through XCreateManagedWIdget APIs. Are this required to use the shape

Re: [PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.

2011-01-31 Thread Michel Dänzer
On Mon, 2011-01-31 at 15:48 +0200, Rami Ylimäki wrote: Signed-off-by: Rami Ylimäki rami.ylim...@vincit.fi --- do_blt.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/do_blt.c b/do_blt.c index 4be2836..fae9e1d 100644 --- a/do_blt.c +++ b/do_blt.c @@

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-01-31 Thread Alan Coopersmith
On 01/31/11 02:46 AM, Rami Ylimäki wrote: It's sometimes impossible to know in advance whether an X client is using Xlib from multiple threads or not. For example, there could be some generic X client that acts as a plugin container. Plugins could be loaded to the container at runtime, but the

Re: EXA: Fix crash with fill using 1x1 tile of depth 8 (bug #24703).

2011-01-31 Thread Matthieu Herrb
Please include this in 1.9.4 if possible commit e06fa804009798ea95efa8babaabb0228dfdfe65 See https://bugs.freedesktop.org/show_bug.cgi?id=24703 On Wed, Dec 22, 2010 at 11:04:10AM +0100, Michel Dänzer wrote: From: Michel Dänzer daen...@vmware.com Fixes

Re: EXA: Fix crash with fill using 1x1 tile of depth 8 (bug #24703).

2011-01-31 Thread Matthieu Herrb
On Mon, Jan 31, 2011 at 09:40:54PM +0100, Matthieu Herrb wrote: Please include this in 1.9.4 if possible commit e06fa804009798ea95efa8babaabb0228dfdfe65 See https://bugs.freedesktop.org/show_bug.cgi?id=24703 Hmm. I didn't realize it was already commited. I checked an out of date tree.

Re: Pull request for libx11 reviewed static analysis fixes

2011-01-31 Thread Alan Coopersmith
On 01/31/11 01:38 AM, Erkki Seppälä wrote: git://gitorious.org/erkkise/libx11-fixes.git fixes-reviewed-1 Merged to ssh://git.freedesktop.org/git/xorg/lib/libX11 0f11c22..e994ab2 master - master -- -Alan Coopersmith-alan.coopersm...@oracle.com Oracle Solaris

Re: [PATCH v2 2/3] [libx11] Using uninitialized value p-modifiers

2011-01-31 Thread Alan Coopersmith
On 01/31/11 02:03 AM, Erkki Seppälä wrote: Small fix by using Xcalloc instead of Xmalloc Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi diff --git a/src/KeyBind.c b/src/KeyBind.c index 6d80a02..ac25ce2 100644 --- a/src/KeyBind.c +++ b/src/KeyBind.c @@ -996,7 +996,7 @@

Re: [PATCH v2 3/3] [libx11] Cannot reach dead statement return NULL;

2011-01-31 Thread Alan Coopersmith
On 01/31/11 02:03 AM, Erkki Seppälä wrote: Check for the NULLness of prop-name and prop-value instead of name and value, which was checked earlier anyway. Decided against using strdup due to curious memory allocation functions and the rest of the xkb not using it either. Signed-off-by:

[PATCH libXi] man: note that callers of XIQueryPointer must free the button mask.

2011-01-31 Thread Peter Hutterer
buttons_return-mask is allocated by the library and must be freed by the caller to avoid leaking. Reported-by: Matthias Clasen mcla...@redhat.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- bonus points to me for great API design... man/XIQueryPointer.txt |3 +++ 1 files

Re: [PATCH evdev] Add third button emulation.

2011-01-31 Thread Peter Hutterer
On Mon, Jan 31, 2011 at 11:48:08AM +0100, Benjamin Tissoires wrote: Thanks, that seems to be a good feature for touchscreen devices! I've got one problem: on which tree does this patch applies? (I've tried against the branch master of xf86-input-evdev): error: patch failed: src/evdev.c:453

[PULL] xserver: enable TLS even if AIGLX is not enabled

2011-01-31 Thread Samuel Thibault
Keith, Please pull the changes below to fix software-rastered aiglx on non-dri systems. Thanks, Samuel The following changes since commit be3be7580b6f6fd2f7fa4d4abfe5e1ab19470223: Merge remote branch 'ajax/for-keithp' (2011-01-20 21:21:21 -0800) are available in the git repository at:

Re: supporting non-rectangular windows

2011-01-31 Thread Pat Kane
You should add a line like this too: XSelectInput(dsp, win, ExposureMask|ButtonPressMask|ButtonReleaseMask ); On Mon, Jan 31, 2011 at 9:39 AM, Pat Kane pekan...@gmail.com wrote: Add this line just before the event loop:  XMapWindow(dsp, win); Pat --- On Mon, Jan 31, 2011 at 2:05 AM,

Re: [PATCH v2 00/25] Various fixes based on static analysis - remaining patches

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Here are the remaining patches of the libx11 static analysis batch that have not yet received feedback from the list. This batch has the comments fixed so that the actual change is first, while the diagnosis from the tool follows, thus making git

Re: [PATCH v2 01/25] [libx11] Fixed a missing call to XFreeFont

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Variable fs not freed or pointed-to in function get_prop_name Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/XDefaultOMIF.c |5 - 1

Re: [PATCH v2 02/25] [libx11] Removed unused assignment

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Pointer pBuf returned from fgets(buf, 256, stream) is never used Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files

Re: [PATCH v2 03/25] [libx11] Removed unused assignment

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Pointer pBuf returned from fgets(buf, 256, stream) is never used Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xcms/cmsColNm.c |2 +- 1 files

Re: [PATCH v2 04/25] [libx11] Zero-initialized new

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Using uninitialized value new Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/xlibi18n/lcGeneric.c |2 +- 1 files changed, 1 insertions(+), 1

Re: [PATCH v2 05/25] [libx11] Fixed by using strncpy and explicitly terminating the buffer

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Possible overrun of 8192 byte fixed size buffer buffer by copying ext-name without length checking Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi ---

Re: [PATCH util-macros] XORG_WITH_XSLTPROC: add XSLT processor command line tool

2011-01-31 Thread Matt Dew
On 01/29/2011 05:23 PM, Gaetan Nadon wrote: The primary use will be for DocBook/XML cross links database generation. XSLT (Extensible Stylesheet Language Transformations) is a declarative, XML-based language used for the transformation of XML documents. The xsltproc command line tool is for

Re: supporting non-rectangular windows

2011-01-31 Thread Prasanta Sadhukhan
Thanks. I added the following lines as told. Now I am getting a window but 1) it is not circular shaped although I am using X shape extension API 2) it is not accepting any input. XNextEvent() still hangs attached is the modified program. Anything else I need to add Also, can anyone help me to

Re: [PATCH v2 06/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Variable colormap_ret goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2

Re: [PATCH v2 07/25] [libx11] Fixed memory leak by adding Xfree and initializing missing_list with NULL

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:01 AM, Erkki Seppälä wrote: Variable missing_list goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |3 ++- 1 files changed, 2

Re: [PATCH v2 08/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Variable colormap_ret goes out of scope Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRmAttr.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/modules/im/ximcp/imRmAttr.c

Re: [PATCH v2 09/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Variable colormap_ret goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRm.c |2 ++ 1 files changed, 2 insertions(+),

Re: [PATCH v2 10/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Variable colormap_ret goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- modules/im/ximcp/imRm.c |2 ++ 1 files changed, 2 insertions(+),

Re: [PATCH v2 11/25] [libx11] Fixed memory leak by adding Xfree

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Variable image goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/ImUtil.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-)

Re: [PATCH v2 12/25] [libx11] Instead of copying the value returned by get_prop_name and then releasing it, directly use the return value of get_prop_name, which allocates memory for the name.

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Subject: [PATCH v2 12/25] [libx11] Instead of copying the value returned by get_prop_name and then releasing it, directly use the return value of get_prop_name, which allocates memory for the name. Variable prop_name not freed or pointed-to in function

Re: [PATCH v2 12/25] [libx11] Instead of copying the value returned by get_prop_name and then releasing it, directly use the return value of get_prop_name, which allocates memory for the name.

2011-01-31 Thread Alan Coopersmith
On 01/31/11 11:42 PM, Alan Coopersmith wrote: Plus this would solve the unused variable prop_name warning that your patch would introduce. Never mind that bit, your patch still used prop_name, just as an extra variable to copy through. -- -Alan Coopersmith-

Re: [PATCH v2 14/25] [libx11] Fixed the handling of the extremely unlikely situation of fstat failing

2011-01-31 Thread Alan Coopersmith
You could shorten the summary to: Handle the extremely unlikely situation of fstat failing since we hope most patches fix something, it's not always necessary to add in Fixed the... when other verbs can work. On 01/31/11 04:02 AM, Erkki Seppälä wrote: Tracked variable size was passed to a

Re: [PATCH v2 13/25] [libx11] The NEWTABLE macro missed freeing its allocated memory on subsequent memory allocation errors. Added call to Xfree.

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: Variable table goes out of scope Reviewed-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com Signed-off-by: Erkki Seppälä erkki.sepp...@vincit.fi --- src/Xrm.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)

Re: [PATCH v2 16/25] [libx11] property_return was not free'd if the allocation of pRedTbl failed.

2011-01-31 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: From: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com xcms/LRGB: Fix potential resource leak. Reviewed-by: Erkki Seppälä erkki.sepp...@vincit.fi Signed-off-by: Ander Conselvan de Oliveira ander.conselvan-de-olive...@nokia.com