Commit graph

117 commits

Author SHA1 Message Date
Jon TURNEY
3d69b0a83e Don't try so hard to find a matching font with the given encoding
See http://sourceware.org/bugzilla/show_bug.cgi?id=10948

Currently, if the locale is UTF-8, no CJK fonts are installed, and someone
does XCreateFontSet() with a font name of "*", we end up asking the server
to list the (non-existent) fonts 11 times for each CJK encoding, which can
take a while.

A * wildcard can match multiple components in a XLFD name in XListFonts(),
so there's no need to try adding more than one to get a match.

We do try once with a leading '*-' in case the fontname isn't a full
well-formed XLFD name, maybe even that isn't needed?

(See also http://invisible-island.net/xterm/xterm.faq.html#slow_menus)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-13 22:27:08 -08:00
Alan Coopersmith
0e45f64766 Drop X_LOCALE fallback for OS'es without setlocale()
C89 or bust!   This was documented as being needed for "only Lynx,
Linux-libc5, OS/2" and has never been enabled in modular builds,
since none of those platforms have had anyone step up to add support
since the X11R7 conversion to autotools.

Mostly performed with unifdef -UX_LOCALE, followed by removal of files
left without any purpose, and manual cleanup of remaining references.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-22 22:02:17 -08:00
Alan Coopersmith
e9b14d10d0 Bug 68413 - [Bisected]Error in `xterm': realloc(): invalid next size
Pass *new* size to realloc, not old size.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-24 17:27:43 -07:00
Alan Coopersmith
bf3501e039 Remove unnecessary casts of pointers to (char *) in calls to Xfree()
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.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
25a7a329de Remove even more casts of return values from Xmalloc/Xrealloc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
e7d46c6452 i18n modules: Fix some const cast warnings
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 target type [-Wcast-qual]

lcGenConv.c: In function 'byteM_parse_codeset':
lcGenConv.c:345:13: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
453c4ee436 Avoid memory leak/corruption if realloc fails in imLcPrs.c:parseline()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:04 -07:00
Alan Coopersmith
5d47a39978 omGeneric.c: convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-08-20 12:50:47 -07:00
Alan Coopersmith
88a27a2aa9 ximcp/imRm.c: convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-08-20 12:50:40 -07:00
ISHIKAWA,chiaki
8f58e54a5f Fix bogus timestamp generated by XIM
Fix bogus timestamp generted by XIM due to uninitialized
data field. Also set appropriate serial, too.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39367

Signed-off-by: Chiaki ISHIKAWA <ishikawa@yk.rim.or.jp>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-07 08:32:19 -07:00
Egbert Eich
e7fd6f0eda XIM: Fix sync problem on focus change.
XSetICFocus() and XUnsetICFocus() are both asynchronous events.
This is a pretty stupid idea: those functions may undo certain
settings on the client side for which requests from the server
may still be in the queue unprocessed. Thus things may be set
in the wrong order ie instead of set -> unest it will be unset -> set.
Moreover there is no way for either the client or the server to
cause the event queue to be flushed - which is pretty bad as
XIM is bidirectional.
The scenario is as follows:
Two ICs are created:
        ic1 = XCreateIC(im,
            XNInputStyle, XIMPreeditCallbacks | XIMStatusCallbacks,
            XNClientWindow, window,
            XNPreeditAttributes, preedit_attr,
            XNStatusAttributes, status_attr,
            NULL);
        ic2 = XCreateIC(im, XNInputStyle,
                       XIMPreeditNothing | XIMStatusNothing,
                       XNClientWindow, window, NULL);
Then the focus is removed from ic2:
        XUnsetICFocus(ic2);
If SCIM is used as the input server it will send a bunch of requests
following an XCreateIC(). One of the requests registers a key release
filter. XUnsetICFocus() unsets both key press and release filters.
Since it is asynchronous, the input server requests to register key
press and release filters may not have been processed, when XUnsetICFocus()
is called. Since there is no explicite way for client programs to enforce
the request queue to be flushed explicitely before an X[Set/Unset]ICFocus()
call it would be safest to make those two calls synchronous in the sense
that they ensure the request queue has been handled before they execute.
The easiest way to do this from Xlib is thru a call to XGetICValues()
which sends a request to the server and subsequently reads the queue
from the server to the client. This will cause all outstanding requests
in the queue to be read and handled.
This is an ugly hack and this could be fixed directly in the client,
however it seems to be easier to fix Xlib than to fix numerous clients.
This problem arose since there is no well documented way how to handle
and synchronize XIM requests and not all input servers send requests
when an IC is created.
This has been discussed extensively in:
 https://bugzilla.novell.com/show_bug.cgi?id=221326

Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-08-07 16:12:35 +02:00
Egbert Eich
26ec7d3821 XIM: Fix race on focus change: set 'FABRICATED' only when keyev filters in place.
When synthesized key events are sent on commit XIM sets the 'fabricated'
flag so that the keypress handler knows that these were not real events.
This also happens when committing due to the loss of focus. However in this
case the keypress/release filters which consume and unset this flag are no
longer in the filter chain.
So the flag is erronously set when a real keyboard event is received after
focus has been regained. So the first event is wrongly treated as a
fabricated key in the keypress handler which will at the same time reset
the flag so the second key event is treated correctly.
This fix only sets the flag when at least one of the keyboard filters is in
place.
How to reproduce this bug: run scim, choose a Japanese input method start
two instances of xterm: start typing in one xterm (this should pop up an
IM window). Without comitting (hitting 'enter') move focus to the other
xterm, then move focus back. Start typing again. The first character will
be committed immediately without popping up an input window.
With this fix this behavior is gone.

See also: https://bugzilla.novell.com/show_bug.cgi?id=239698

Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-08-07 16:12:34 +02:00
Alan Coopersmith
208e586c80 omGeneric: remove space between struct name & member name
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-27 01:12:45 -07:00
Thomas Klausner
a17ceb7100 Stop truncating source to destination length if it is larger.
It seems useless to do that since the code tests for both source
length and destination to be non-zero. This fixes a cut'n'paste
problem in xterm where the paste length was limited to 1024 (BUFSIZ)
in button.c.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-08 23:11:06 -07:00
Alan Coopersmith
164bf4dfe8 integer overflows in TransFileName() [CVE-2013-1981 9/13]
When trying to process file paths the tokens %H, %L, & %S are expanded
to $HOME, the standard compose file path & the xlocaledir path.
If enough of these tokens are repeated and values like $HOME are set to
very large values, the calculation of the total string size required to
hold the expanded path can overflow, resulting in allocating a smaller
string than the amount of data we'll write to it.

Simply restrict all of these values, and the total path size to PATH_MAX,
because really, that's all you should need for a filename path.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-05-09 18:59:52 -07:00
Alan Coopersmith
460e8a223b integer truncation in _XimParseStringFile() [CVE-2013-1981 8/13]
Called from _XimCreateDefaultTree() which uses getenv("XCOMPOSEFILE")
to specify filename.

If the size of off_t is larger than the size of unsigned long (as in
32-bit builds with large file flags), a file larger than 4 gigs could
have its size truncated, leading to data from that file being written
past the end of the undersized buffer allocated for it.

While configure.ac does not use AC_SYS_LARGEFILE to set large file mode,
builders may have added the large file compilation flags to CFLAGS on
their own.

size is left limited to an int, because if your Xim file is
larger than 2gb, you're doing it wrong.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-05-09 18:59:52 -07:00
Alan Coopersmith
226622349a Unbounded recursion in _XimParseStringFile() when parsing include files [CVE-2013-2004 2/2]
parseline() can call _XimParseStringFile() which can call parseline()
which can call _XimParseStringFile() which can call parseline() ....
eventually causing recursive stack overflow and crash.

Limit is set to a include depth of 100 files, which should be enough
for all known use cases, but could be adjusted later if necessary.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-05-09 18:59:52 -07:00
Alan Coopersmith
b9ba832401 unvalidated length in _XimXGetReadData() [CVE-2013-1997 12/15]
Check the provided buffer size against the amount of data we're going to
write into it, not against the reported length from the ClientMessage.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2013-05-09 18:59:52 -07:00
Alan Coopersmith
9399caf2c1 unifdef MUSTCOPY
MUSTCOPY seems to have only been defined in <X11/Xmd.h> when building for
CRAY, to handle missing some sizes of integer type.

(mostly performed with unifdef, followed by some manual cleanup of
 spacing/indenting in the remaining code)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-03 18:20:10 -08:00
Alan Coopersmith
3cd974b1d4 Remove unused DECnet ("DNETCONN") code from Xlib
Has never been converted to build in modular builds, so has been unusable
since X11R7.0 release in 2005.  DNETCONN support was removed from xtrans
back in 2008.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-09 20:50:32 -08:00
Alan Coopersmith
a6e5b36a3e Remove unused TLI ("STREAMSCONN") code from Xlib
Has never been converted to build in modular builds, so has been unusable
since X11R7.0 release in 2005.  All known platforms with TLI/XTI support
that X11R7 & later releases run on also have (and mostly prefer) BSD
socket support for their networking API.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-09 20:50:32 -08:00
Yaakov Selkowitz
d14b6a250f XIM: remove Private and Public macros
Private is a struct member name in mingw-w64 <winioctl.h>, causing this
useless define in a private header to break the build.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-29 18:43:35 -05:00
Andreas Wettstein
d3b3570592 XIM: Allow modifier releases in compose sequences (#26705)
Currently, only non-modifier keys (actually, keysyms) can be part of a compose
sequence, and they are matched against the defined compose sequences at the
time the key is pressed.  The patch allows to use modifier keys an well, but
matches them on key release, and only if no other key has been pressed after
the modifier.

Releasing a non-matched modifier during an ongoing compose sequence only aborts
the sequence if any modifier release would have matched.  In particular, if no
compose sequences with modifiers are specified, the compose mechanism works
exactly as without this patch.

Even if modifiers are part of a compose sequence, they are not filtered.  This
is because modifiers affect the keyboard state no matter what we do here and,
therefore, filtering them only could confuse clients.

The purpose is this extension to the compose mechanism is to allow to make
better use of keys in convenient reach for touch typing.

Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2011-12-11 16:56:06 -05:00
Alan Coopersmith
d8956520de Fix "nomal" -> "normal" typo in several comments
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-14 17:53:00 -07:00
Xue Wei
002b36e308 mbtocs should not truncate input
Fixes pasting more than 1024 bytes into xterm, as described in
https://bugs.freedesktop.org/show_bug.cgi?id=25209

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-14 17:42:45 -07:00
Choe Hwanjin
738f7b8673 XIM: Make Xim handle NEED_SYNC_REPLY flag
NEED_SYNC_REPLY flag should be in Xim not in Xic.
Because the focused Xic can be changed before sending sync reply.
After focused Xic changed, the new Xic doesn't have NEED_SYNC_REPLY
flag enabled, so libX11 doesn't send XIM_SYNC_REPLY packet.

This patch adds sync reply flag to Xim and removes sync reply
from Xic.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=7869

Signed-off-by: Choe Hwanjin <choe.hwanjin@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-14 17:19:15 -07:00
Yann Droneaud
b5a1086243 Return name instead of False in XSetICValues()
In case of error, XSetICValues() must return the first argument
that failed to be set.

But in some error paths, it returns False, which is converted to NULL,
so the function returns OK in case of error.

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-11 09:58:35 -07:00
Yann Droneaud
10992cb8dc Return name instead of value in XGetIMValues() and XSetIMValues()
As stated in man page (XOpenIM) and Xlib documentation (chapter 13.5.3),
XGetIMValues() and XSetImValues() "returns the name of the first argument
that could not be obtained."

But currently,

  err = XGetIMValues(im, "invalid", &arg, NULL);

returns &arg instead of "invalid".

This patch fixes https://bugs.freedesktop.org/show_bug.cgi?id=12897

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-11 09:56:54 -07:00
Jeremy Huddleston
913603660c Fix potential uninitialized variable access in _XimMakeICAttrIDList
Found by clang static analysis

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-09 02:27:59 -07:00
Alan Coopersmith
b850adbdeb Convert malloc(strlen()); strcpy() sets to strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18 17:49:18 -07:00
Alan Coopersmith
09194042d3 Replace Xmalloc+bzero pairs with Xcalloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18 17:49:13 -07:00
Ander Conselvan de Oliveira
ac1e2bff71 om: Fix memory leaks on get_font_name error paths.
While at it, remove unneeded check for NULL before Xfree.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:06:00 +03:00
Ander Conselvan de Oliveira
d749948f94 om: Fix potential memory leak in init_om.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
d0749d6abd om: Fix memory leak on read_EncodingInfo error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
4b2e8d00f5 Fix memory leaks on _XimCbDispatch error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
46e6c78b1a Fix memory leak on _XimCommitRecv error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
0ace642a2d Fix memory leaks on _XimWriteCachedDefaultTree error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
e29be94edb Fix memory leaks on _XimGetAttributeID error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
d144a50512 Fix memory leaks on _XimProtoCreateIC error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
6a452f7a98 Fix leaks in _XimEncodingNegotiation error paths.
name_ptr and detail_ptr weren't free'd in some cases before returning
False.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Alan Coopersmith
c1c91e9a22 Fix "attrinute" typo in comments in ximcp
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-12 20:50:42 -07:00
Erkki Seppälä
b993d73bb3 im/ximcp: release modifiermap before returning
Variable "map" goes out of scope

Release modifiermap before returning. Reordered code to call
XGetModifierMapping after the first return from the function.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
2011-03-11 12:38:08 +02:00
Samuel Thibault
40812b53ff Make the Local XIM request key releases for braille
Braille chords management needs key release events. We need to explicitly
request then, else GTK would not pass them throught XFilterEvent and braille
wouldn't work.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 21:54:17 +01:00
Samuel Thibault
c97c42c49c Match braille patterns with compose tree
Braille patterns should also be usable in Compose.  This combines the
implementation of braille chords and compose tree: only emit the braille
pattern if it can not be found in the compose tree, if any.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 17:27:38 +01:00
Samuel Thibault
0c6ca565d7 Fix status reporting for braille patterns
_XimLocalMbLookupString can return a braille keysym even if _Xlcwctomb can't
convert to the current MB charset.
_XimLocalUtf8LookupString needs to set the braille keysym and status too.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 15:56:54 +01:00
Alan Coopersmith
6ac417cea1 ximcp: Prevent memory leak & double free if multiple %L in string
In the highly unlikely event that TransFileName was passed a path
containing multiple %L entries, for each entry it would call
_XlcFileName, leaking the previous results, and then for each entry it
would copy from that pointer and free it, resulting in invalid pointers
& possible double frees for each use after the first one freed it.

Error: Use after free (CWE 416)
   Use after free of pointer 'lcCompose'
        at line 358 of modules/im/ximcp/imLcPrs.c in function 'TransFileName'.
          Previously freed at line 360 with free.
Error: Use after free (CWE 416)
   Use after free of pointer 'lcCompose'
        at line 359 of modules/im/ximcp/imLcPrs.c in function 'TransFileName'.
          Previously freed at line 360 with free.
Error: Double free (CWE 415)
   Double free of pointer 'lcCompose'
        at line 360 of modules/im/ximcp/imLcPrs.c in function 'TransFileName'.
          Previously freed at line 360 with free.

[ This bug was found by the Parfait 0.3.6 bug checking tool.
  For more information see http://labs.oracle.com/projects/parfait/ ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-11 14:42:37 -08:00
Ander Conselvan de Oliveira
e2566e43b0 lc/def/lcDefConv: Use Xcalloc to avoid use of uninitialized memory
Fixed by zero'ing conv on allocation with Xcalloc. Then
close_converter works properly.

Using uninitialized value "conv->state" in call to function "close_converter"

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-01 23:47:11 -08:00
Erkki Seppälä
1346b9ea3b ximcp/imLckup: Handle negative return value from _Xlcwctomb
Fixed by negative value to memcpy by checking for the negative return
value of _Xlcwctomb and returning 0/XLookupNone in that case.

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. Each of
these has a specific meaning attached.

Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-01 23:46:58 -08:00
Erkki Seppälä
79a5c86e02 ximcp/imTrX: Handle failing XGetWindowProperty
Checked return value of XGetWindowProperty and return false if it fails.

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

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-01 23:46:51 -08:00
Erkki Seppälä
d695f5da9f ximcp/imRm: Handle leaking colormap_ret
Fixed memory leak by adding Xfree for colormap_ret

Variable "colormap_ret" goes out of scope

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-01 23:45:53 -08:00