Commit graph

71 commits

Author SHA1 Message Date
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
Erkki Seppälä
f9eda19d08 ximcp/imRmAttr: Handle leaking missing_list
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-01 23:45:45 -08:00
Erkki Seppälä
3183269e09 ximcp/imRmAttr: Handle leaking colormap_ret
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>
2011-02-01 23:45:40 -08:00
Alan Coopersmith
b15b8a558e Sun's copyrights are now owned by Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-09-03 23:11:53 -07:00
Fernando Carrijo
6de368c9aa Purge macros NEED_EVENTS and NEED_REPLIES
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-07-07 15:12:34 -07:00
Josh Triplett
15e5eaf628 Remove support for building without XCB
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-06-03 22:19:14 -07:00
Jeremy Huddleston
d232b259c3 Fix various build warnings
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-04-23 15:52:51 -07:00
Gaetan Nadon
b5797597f8 config: move CWARNFLAGS from configure.ac to Makefile.am
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-02-19 09:22:56 -05:00
Alan Coopersmith
ddb1786720 Purge CVS/RCS id tags
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-14 17:38:26 -08:00
Alan Coopersmith
c1db9ddcfa Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-14 15:39:14 -08:00
James Cloos
9df349a789 Allow inclusion of system level compose files.
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-13 11:04:38 -05:00
Osamu Sayama
4d4676c0d6 set_fontset_extents crash after get_rotate_fontname fix in 2bef065b70
- 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>
2010-01-06 13:17:40 -08:00
Jeremy Huddleston
3bb020587c Split CFLAGS into CPPFLAGS and CFLAGS
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-10-01 22:20:38 -07:00
Christoph Pfister
2bef065b70 X.Org Bug #21117: crash in get_rotate_fontname (omGeneric.c)
http://bugs.freedesktop.org/show_bug.cgi?id=21117

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-27 22:35:29 -07:00
Theppitak Karoonboonyanan
128daff442 Thai XIM not retrieve MB surrounding on UTF-8 LC
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-13 17:27:03 +01:00
Theppitak Karoonboonyanan
e09f0d227f Thai XIM not filters when NumLock or CapsLock is on
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-04-13 17:26:26 +01:00
Alan Coopersmith
c9f84af591 Remove ifdef checks for macII left over from ancient A/UX 3.0 support
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-17 14:59:16 -07:00
Paulo Cesar Pereira de Andrade
1bd2966ed8 patches to avoid gcc warnings for libX11 (#4)
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-29 20:25:15 -02:00
Paulo Cesar Pereira de Andrade
f16dd6af3e patches to avoid gcc warnings for libX11 (#3)
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-29 20:22:21 -02:00
Paulo Cesar Pereira de Andrade
a1977883c9 Janitor: Correct some gcc/sparse warnings.
Most remaining warnings are about XIM/Xim to/from conversion
and discarding const from pointers.
2009-01-29 15:01:06 -02:00
Paulo Cesar Pereira de Andrade
8ba0ca32a6 Janitor: ansification, make distcheck, compiler warnings.
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.
2009-01-28 20:31:42 -02:00
Stefan Dirsch
67e34d7a82 Added remaining xlib patch required for gb18030 support (#1573). 2008-11-22 19:40:54 +01:00
Stefan Dirsch
55782a0a1f Added remaining hunk of Egbert's patch to prevent XIM deadlocks (#1182). 2008-11-22 17:53:06 +01:00
Colin Harrison
ad6008a0c9 Fix copy/paste typo in imLcPrs
Signed-off-by: James Cloos <cloos@jhcloos.com>
2008-11-06 17:48:21 -05:00
Adam Jackson
0f0168ad18 Fix leak in _XimXGetReadData
Spotted by Denis Dzyubenko
2008-11-06 14:54:13 -05:00
Adam Jackson
f6af6dd2f7 Bug #14898: Don't abuse the sprintf() implementation.
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-24 13:16:53 -04:00
Alan Coopersmith
cf49e53701 Strip whitespace from end of lines in source files 2008-06-17 14:41:17 -07:00
Adam Jackson
a7f85567a3 Bug #15884: Remove useless sleep()'s from the connection code.
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-05-13 10:28:39 -04:00
Theppitak Karoonboonyanan
0b6682303e IM: Respect XMODIFIERS for Thai locale (bug #15719)
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-04-28 11:51:25 +03:00
Søren Sandmann Pedersen
1a1a42a3ca XIM: Fix a hand when switching input context.
Red Hat bug #201284.
2008-02-24 20:03:35 -05:00
Yann Droneaud
24527c92fd XIM: Properly initialise client event
Make sure all ClientMessage fields are initialised to 0 before we send it.
2007-10-24 19:26:07 +03:00
Jamey Sharp
c2f88cdf5c Fix locking in _XimGetWindowEventmask.
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?
2007-06-10 16:19:59 -07:00
Tilman Sauerbeck
91b02b8064 More constification. 2007-05-17 19:07:34 +02:00
Tilman Sauerbeck
0e8d9ca47d More constification. 2007-05-16 19:36:23 +02:00
Tilman Sauerbeck
1c75a94790 Bug #10475: Fixed lots of char*/const char* mixups.
I didn't fix all of them, as that would require touching
public headers.
2007-04-06 11:59:31 +02:00
Julien Cristau
bc80f9fe3c Bug #9279: Fixed a file descriptor leak. 2007-03-18 13:14:48 +01:00
Matthias Hopf
686bb8b35a Fix double open of compose file.
Issue found by Kees Cook <kees@canonical.com>.
2006-10-18 14:25:04 +02:00
Matthias Hopf
abda4d223e Update to final Compose cache directory location. 2006-06-29 18:59:57 +02:00
Matthias Hopf
40a64c61f8 Fix alignment of trees and wide chars in the cache. 2006-06-29 17:41:41 +02:00
Matthias Hopf
f442dcaa56 First (dummy) entry of compose caches was not initialized and thus contained varying garbage. 2006-06-28 19:17:03 +02:00
Matthias Hopf
1f4c9893ad Bug #3104: Compose table cache for faster X11 application starts. 2006-06-16 16:31:37 +02:00
Matthias Hopf
4fe22647e6 Bug #3104: Compose table cache for faster X11 application starts. 2006-06-16 16:31:37 +02:00
Matthias Hopf
9354351fcb Bug #3104: Compose table cache for faster X11 application starts. Part 1: Pointerless compose data structure, using indices instead of pointers, needed for mmap()ing data structure. 2006-06-16 16:31:37 +02:00
Daniel Stone
d6fba1f44d im: add Braille input method (#6296)
Bug #6296: Add a Braille input method.  (Samuel Thibault)
2006-06-02 02:24:25 +03:00
Jamey Sharp
f25b4b00e1 Move .cvsignore to .gitignore. 2006-02-19 12:28:41 -08:00
Jamey Sharp
881467b303 Merge the X11 and BIGREQS package sets: they were used in exactly the same places. 2006-02-19 02:14:11 +00:00
Kevin E Martin
9e96dbc343 Add check and cflags for malloc(0) returning NULL. 2005-12-03 04:41:47 +00:00