summaryrefslogtreecommitdiff
path: root/modules
AgeCommit message (Collapse)AuthorFilesLines
2011-04-13om: Fix memory leaks on get_font_name error paths.Ander Conselvan de Oliveira1-8/+6
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-13om: Fix potential memory leak in init_om.Ander Conselvan de Oliveira1-10/+12
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13om: Fix memory leak on read_EncodingInfo error path.Ander Conselvan de Oliveira1-1/+3
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix memory leaks on _XimCbDispatch error path.Ander Conselvan de Oliveira1-0/+2
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix memory leak on _XimCommitRecv error path.Ander Conselvan de Oliveira1-1/+3
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix memory leaks on _XimWriteCachedDefaultTree error paths.Ander Conselvan de Oliveira1-1/+4
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix memory leaks on _XimGetAttributeID error paths.Ander Conselvan de Oliveira1-2/+6
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix memory leaks on _XimProtoCreateIC error paths.Ander Conselvan de Oliveira1-2/+2
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13Fix leaks in _XimEncodingNegotiation error paths.Ander Conselvan de Oliveira1-26/+25
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-12Fix "attrinute" typo in comments in ximcpAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-11im/ximcp: release modifiermap before returningErkki Seppälä1-2/+9
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-02-21Make the Local XIM request key releases for brailleSamuel Thibault1-1/+1
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-21Match braille patterns with compose treeSamuel Thibault1-12/+22
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-21Fix status reporting for braille patternsSamuel Thibault1-10/+20
_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-11ximcp: Prevent memory leak & double free if multiple %L in stringAlan Coopersmith1-2/+3
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-01lc/def/lcDefConv: Use Xcalloc to avoid use of uninitialized memoryAnder Conselvan de Oliveira2-2/+2
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-01ximcp/imLckup: Handle negative return value from _XlcwctombErkki Seppälä1-0/+4
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-01ximcp/imTrX: Handle failing XGetWindowPropertyErkki Seppälä1-12/+21
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-01ximcp/imRm: Handle leaking colormap_retErkki Seppälä1-0/+4
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-01ximcp/imRmAttr: Handle leaking missing_listErkki Seppälä1-1/+2
Fixed memory leak by adding Xfree and initializing missing_list with NULL Variable "missing_list" 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-01ximcp/imRmAttr: Handle leaking colormap_retErkki Seppälä1-1/+3
XFree colormap_ret and initialize it when appropriate. Variable "colormap_ret" goes out of scope 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>
2010-09-03Sun's copyrights are now owned by OracleAlan Coopersmith5-5/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-07Purge macros NEED_EVENTS and NEED_REPLIESFernando Carrijo10-11/+0
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-03Remove support for building without XCBJosh Triplett6-6/+0
And there was much rejoicing. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Consensus on #xorg-devel agrees with removing --without-xcb; in particular, acks from Adam Jackson, Daniel Stone, Kristian Høgsberg, Julien Cristau, and Rémi Cardona.
2010-04-23Fix various build warningsJeremy Huddleston3-9/+4
imLcIm.c: In function '_XimCachedFileName': imLcIm.c:361: warning: format '%03x' expects type 'unsigned int', but argument 8 has type 'long unsigned int' imLcIm.c:364: warning: format '%03x' expects type 'unsigned int', but argument 8 has type 'long unsigned int' imRm.c: In function '_XimDefaultArea': imRm.c:597: warning: cast from pointer to integer of different size imRm.c: In function '_XimDefaultColormap': imRm.c:626: warning: cast from pointer to integer of different size lcFile.c:224: warning: no previous prototype for 'xlocaledir' lcUTF8.c: In function 'iconv_cstombs': lcUTF8.c:1841: warning: assignment discards qualifiers from pointer target type lcUTF8.c:1869: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness lcUTF8.c:1873: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness lcUTF8.c: In function 'iconv_mbstocs': lcUTF8.c:1935: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness lcUTF8.c: In function 'iconv_mbtocs': lcUTF8.c:2031: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness lcUTF8.c: In function 'iconv_mbstostr': lcUTF8.c:2121: warning: pointer targets in passing argument 2 of 'mbtowc' differ in signedness lcUTF8.c: In function 'iconv_strtombs': lcUTF8.c:2180: warning: pointer targets in passing argument 1 of 'wctomb' differ in signedness lcUTF8.c: In function '_XlcAddGB18030LocaleConverters': lcUTF8.c:2367: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2368: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2373: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2374: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2375: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2376: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type lcUTF8.c:2377: warning: passing argument 5 of '_XlcSetConverter' from incompatible pointer type XlibInt.c: In function '_XGetHostname': XlibInt.c:3441: warning: implicit declaration of function 'gethostname' XlibInt.c:3441: warning: nested extern declaration of 'gethostname' ConnDis.c: In function '_XDisconnectDisplay': ConnDis.c:540: warning: old-style function definition ConnDis.c: In function '_XSendClientPrefix': ConnDis.c:554: warning: old-style function definition ConnDis.c: In function 'XSetAuthorization': ConnDis.c:677: warning: old-style function definition Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-02-19config: move CWARNFLAGS from configure.ac to Makefile.amGaetan Nadon6-6/+12
Compiler warning flags should be explicitly set in the makefile rather than being merged with other packages compiler flags. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-01-14Purge CVS/RCS id tagsAlan Coopersmith40-77/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-14Update Sun license notices to current X.Org standard formAlan Coopersmith5-72/+176
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-13Allow inclusion of system level compose files.James Cloos1-0/+16
With the release of XFree86 4.4 an inclusion system of compose files was added to Xlib to allow inclusion of the default compose file (with %L), any compose files from user’s home directory (with %H), or a compose file with a hard coded path¹. However, even today including system level compose files is not possible in a platform independent manner although the machinery for including compose files and overriding previously defined compositions is already in place. With the ability to include system level compose files one could greatly reduce the need for compose file rule duplication and the work needed to propagate changes in one compose file to others. For example, currently the Finnish compose file fi_FI.UTF-8 weights over 5000 lines² but it is almost identical with en_US.UTF-8 except for perhaps half a dozen compositions. This commit allows one to include system level compose files with the following kind of syntax: include "%S/en_US.UTF-8/Compose" 1] http://www.xfree86.org/4.4.0/RELNOTES5.html#42 2] http://cgit.freedesktop.org/xorg/lib/libX11/tree/nls/fi_FI.UTF-8/Compose.pre Signed-off-by: Marko Myllynen <myllynen@redhat.com> Signed-off-by: James Cloos <cloos@jhcloos.com>
2010-01-06set_fontset_extents crash after get_rotate_fontname fix in 2bef065b70f7Osamu Sayama1-2/+2
- In set_fontset_extents, check font_data is not NULL before running loop that may increment it to a non-NULL invalid pointer. - Make sure get_rotate_fontname counts the final field Fixes OpenSolaris bug 6913809: X application dumps core in ja_JP.UTF-8 locale <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6913809> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2009-10-01Split CFLAGS into CPPFLAGS and CFLAGSJeremy Huddleston6-15/+27
On some build systems, CPPFLAGS is set to "-I/some/prefix/include". If older X11 headers are in /some/prefix/include, they will be preferred over the shipped headers. This corrects that problem.
2009-04-27X.Org Bug #21117: crash in get_rotate_fontname (omGeneric.c)Christoph Pfister1-0/+2
http://bugs.freedesktop.org/show_bug.cgi?id=21117 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-13Thai XIM not retrieve MB surrounding on UTF-8 LCTheppitak Karoonboonyanan1-4/+28
On th_TH.UTF-8 locale, Thai XIM rejects all combining characters for GTK+ apps that use X Input Method. This is because GTK+ imxim immodule passes surrounding text in locale encoding, which is UTF-8 for UTF-8 locales. But current Thai XIM in Xlib assumes the multi-byte StringConversionText response for the StringConversionCallback to always be TIS-620, by retrieving a single byte and using it as-is. If the Thai XIM tries to convert the multi-byte text based on locale codeset before using it, it will work again. X.Org But 12759 <http://bugs.freedesktop.org/show_bug.cgi?id=12759> Signed-off-by: Theppitak Karoonboonyanan <thep@linux.thai.net> Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-04-13Thai XIM not filters when NumLock or CapsLock is onTheppitak Karoonboonyanan1-1/+17
The Thai XIM component in libx11 activated on 'th*' locales normally filters input sequence according to orthographic rules. However, when NumLock/CapsLock is on, this stops working. All sequences are passed through. This is caused by missing masks in _XimThaiFilter(), which normally screens out certain special keys from entering orthographic rules. Unfortunately, this included events with NumLock/CapsLock on. Negating the masks from the check allows the events to be tested by the rules. X.Org Bug 12517 <http://bugs.freedesktop.org/show_bug.cgi?id=12517> Signed-off-by: Theppitak Karoonboonyanan <thep@linux.thai.net> Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-03-17Remove ifdef checks for macII left over from ancient A/UX 3.0 supportAlan Coopersmith3-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-29patches to avoid gcc warnings for libX11 (#4)Paulo Cesar Pereira de Andrade1-1/+1
Author is Peter Breitenlohner <peb@mppmu.mpg.de> Bug #17946, attachment #19443 This patch avoids the gcc warning ../../../../libX11-1.1.5/modules/im/ximcp/imDefLkup.c:223: warning: passing arg 1 of `_XimProcSyncReply' from incompatible pointer type (same as already done at other places) BTW: what is the difference between XIM (the type of ic->core.im) and Xim ?
2009-01-29patches to avoid gcc warnings for libX11 (#3)Paulo Cesar Pereira de Andrade1-2/+2
Author is Peter Breitenlohner <peb@mppmu.mpg.de> Bug #17946, attachment #19441 This patch avoids the two gcc warnings ../../../../libX11-1.1.5/modules/im/ximcp/imRm.c:413: warning: assignment discards qualifiers from pointer target type ../../../../libX11-1.1.5/modules/im/ximcp/imRm.c:450: warning: assignment discards qualifiers from pointer target type Note, that this as a rather crude fix of the problem (and it is really a shame to cast name_table to non-const). The right solution would be to declare XIMValuesList.supported_values (in include/X11/Xlib.h) as 'const char **' (or '_Xconst char **'). This will, however, require extensive modifications in various places.
2009-01-29Janitor: Correct some gcc/sparse warnings.Paulo Cesar Pereira de Andrade1-1/+1
Most remaining warnings are about XIM/Xim to/from conversion and discarding const from pointers.
2009-01-28Janitor: ansification, make distcheck, compiler warnings.Paulo Cesar Pereira de Andrade24-178/+43
Only convert to use "ansi prototypes" the functions warned from compilation with "./autogen.sh --prefix=/usr", on a Linux computer. Also, only address "trivial" compiler warning fixes in this commit. The new .gitignore is the output of a command like: % find . -name .gitignore -exec cat {} \; | sort | uniq and only the toplevel .gitignore file was kept.
2008-11-22Added remaining xlib patch required for gb18030 support (#1573).Stefan Dirsch1-3/+11
2008-11-22Added remaining hunk of Egbert's patch to prevent XIM deadlocks (#1182).Stefan Dirsch1-1/+1
2008-11-06Fix copy/paste typo in imLcPrsColin Harrison1-1/+1
Signed-off-by: James Cloos <cloos@jhcloos.com>
2008-11-06Fix leak in _XimXGetReadDataAdam Jackson1-0/+1
Spotted by Denis Dzyubenko
2008-06-24Bug #14898: Don't abuse the sprintf() implementation.Adam Jackson1-1/+2
The thing you're printing into should not itself appear in the list of things to print from, that's bad juju. Just use strcat().
2008-06-17Strip whitespace from end of lines in source filesAlan Coopersmith34-421/+421
2008-05-13Bug #15884: Remove useless sleep()'s from the connection code.Adam Jackson1-3/+0
For network transports, there's enough delay in the network layer already without adding more. For local transports, just hurry up and fail if the server isn't there.
2008-04-28IM: Respect XMODIFIERS for Thai locale (bug #15719)Theppitak Karoonboonyanan1-1/+7
When looking at Thai input methods, make sure XMODIFIERS is checked before jumping straight into built-in Thai processing, so external XIM servers such as SCIM can be used with Thai.
2008-02-24XIM: Fix a hand when switching input context.Søren Sandmann Pedersen2-2/+11
Red Hat bug #201284.
2007-10-24XIM: Properly initialise client eventYann Droneaud1-0/+2
Make sure all ClientMessage fields are initialised to 0 before we send it.
2007-06-10Fix locking in _XimGetWindowEventmask.Jamey Sharp1-1/+1
Now that XFilterEvent drops the Display lock before invoking callback functions, _XimGetWindowEventmask is called without the lock held. So when it called _XGetWindowAttributes, a variant of XGetWindowAttributes that does not lock the Display, Xlib/XCB would assert: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed. Should fix Gentoo #156367, Ubuntu #87947, Debian #427296. And others?