summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-30Added more id attributes to functions.HEADmasterMatt Dew2-45/+45
2011-04-16Add id attributes to functions.Matt Dew17-569/+567
2011-04-15Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/lib/libX11matt10-56/+73
2011-04-14Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/lib/libX11matt5-12/+6
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-13xcms: Fix memory leaks on LINEAR_RGB_InitSCCData error path.Ander Conselvan de Oliveira1-3/+3
pScreenData is replaced when building per visual intensity tables. If malloc failed the old value of pScreenData (stored also in pScreenDefaultData) was being leaked. Also, property_return wasn't free'd in that case. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13xcms: Fix error on LINEAR_RGB_InitSCCData error path.Ander Conselvan de Oliveira1-1/+1
Due to what looks like a copy & paste error, pScreenData->pBlueTbl would be accessed after being free'd. 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-13FSWrap: fix potential leak in copy_string_listAnder Conselvan de Oliveira1-1/+1
If list_count is 0, dst would be allocated and leaked. 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 with broken bitmap files in XReadBitmapFileDataAnder Conselvan de Oliveira1-0/+5
Bitmap file data is read looping through the lines in the input file. If there is extra data after the bitmap, these lines will be processed and if this data represents another bitmap it will replace the one read before causing the memory allocated for bits to leak. This changes the code to stop processing the file once a bitmap was read. 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-04-12Make doc install subdirectories more like the pre-docbook.am pathsAlan Coopersmith4-4/+4
Haven't restored the "specs" path in the install path, but have restored libX11 & i18n subdirectories in the path for better logical grouping. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-12Install xml versions of specs even if HAVE_XMLTO is falseAlan Coopersmith7-12/+2
Moves HAVE_XMLTO check into docbook.am, more closely matches behaviour from before docbook.am changes (commit e8c76407d2f6e3) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-09Install xml versions of specs even if HAVE_XMLTO is falseAlan Coopersmith4-6/+2
Moves HAVE_XMLTO check into docbook.am, more closely matches behaviour from before docbook.am changes (commit e8c76407d2f6e3) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-05libX11 1.4.3Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-30Documentation: add Docbook external references supportGaetan Nadon9-184/+189
When writing technical documentation, it is often necessary to cross reference to other information. When that other information is not in the current document, additional support is needed, namely <olink>. A new feature with version 1.7 of xorg-sgml-doctools adds references to other documents within or outside this package. This patch adds technical support for this feature but does not change the content of the documentation as seen by the end user. Each book or article must generate a database containing the href of sections that can be referred to from another document. This database is installed in DATAROOTDIR/sgml/X11/dbs. There is a requirement that the value of DATAROOTDIR for xorg-sgml-doctools and for the package documentation is the same. This forms a virtual document tree. This database is consulted by other documents while they are being generated in order to fulfill the missing information for linking. Refer to the xorg-sgml-doctools for further technical information. Co-authored-by: Matt Dew <marcoz@osource.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-03-21Add #define XK_SINHALAHarshula Jayasuriya1-0/+1
Add #define XK_SINHALA so that the Sinhala keysyms can be used by the lk xkb keymap. Signed-off-by: Harshula Jayasuriya <harshula@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-03-17configure.ac: Bump version to 1.4.2Jeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-03-15Call _XErrorFunction without holding the Display lock.Jamey Sharp1-1/+13
Historically, Xlib dropped the Display lock around the upcall to any user-supplied _XErrorFunction, but somewhere along the way I quit doing that if you built with XCB. The reasons are lost somewhere in the pre-git history of Xlib/XCB, and I can't now see any reason to hold the lock. The documentation for XSetErrorHandler still applies though: Because this condition is not assumed to be fatal, it is acceptable for your error handler to return; the returned value is ignored. However, the error handler should not call any functions (directly or indirectly) on the display that will generate protocol requests or that will look for input events. So while you are now once again permitted to re-enter Xlib from the error handler, you're only allowed to call non-protocol functions. Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-03-14Ignore user locks after sleeping in _XReply and _XReadEvents.Jamey Sharp1-2/+13
This bug appears as a hang in applications that wait for replies from multiple threads, where one such thread has taken a user lock using XLockDisplay. Prior to this fix, the code could deadlock in this way: If thread 1 goes to sleep waiting for a reply, and then thread 2 takes a user lock and waits for a reply, then thread 2 will wait for thread 1 to process its reply (because responses must be processed in order), but thread 1 will wait for thread 2 to drop its user lock. Fixed by making thread 1 not wait for thread 2 to drop its user lock. This makes the semantics of user locks hard to define, but they were already hard to define. The new behavior appears to be consistent with the way Xlib worked historically, anyway. Fixes: http://lists.freedesktop.org/archives/xcb/2011-March/006802.html There was a similar potential for deadlock in _XReadEvents, fixed the same way, with the same caveats about user-lock semantics. Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-03-11xkb: XkbPropertyPtr determined allocation success from wrong variablesErkki Seppälä1-2/+2
Cannot reach dead statement "return NULL;" 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.seppala@vincit.fi> Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
2011-03-11keyBind: Use Xcalloc to initialize allocated _XKeytransErkki Seppälä1-1/+1
Using uninitialized value "p->modifiers" Small fix by using Xcalloc instead of Xmalloc Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Alan Coopersmith <alan.coopersmith at 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-25Docbook: change the book id to match the xml file basenameGaetan Nadon2-3/+3
This is required for the up-coming external references support. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
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-11Clean up memory when first XCreateRegion succeeds and second failsAlan Coopersmith1-2/+11
Error: Memory leak (CWE 401) Memory leak of pointer 's' allocated with XCreateRegion() at line 387 of /export/alanc/X.Org/sx86-gcc/lib/libX11/src/Region.c in function 'XShrinkRegion'. 's' allocated at line 387 with XCreateRegion(). s leaks when s != 0 at line 387. Error: Memory leak (CWE 401) Memory leak of pointer 'tra' allocated with XCreateRegion() at line 1452 of /export/alanc/X.Org/sx86-gcc/lib/libX11/src/Region.c in function 'XXorRegion'. 'tra' allocated at line 1451 with XCreateRegion(). tra leaks when tra != 0 at line 1451. [ 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-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-09xcms/cmsProp: don't deal with uninitialized values, fail insteadErkki Seppälä1-7/+10
Properly handle the return value of XGetWindowProperty by considering if after the loop as well. Using freed pointer "prop_ret" There were numerous things wrong in how this function interacted with XGetWindowProperty. None of the local variables were initialized and remained that way if the call to XGetWindowProperty returned 1 (not Succeed). That doesn't result in after_ret being initialized in which case if it happens to be 0, the loop was exited. In that case format_ret and nitems_ret were uninitialized and the function might return with success (but with uninitialized pointer in prop_ret) or XcmsFailure. As the buffer enlarging code was called only when XGetWindowProperty failed (returned not Success), after_ret would not have been initialized. It would have been initialized only if the XGetWindowProperty has returned Success earlier, but in that case the code fragment would not have been reached. This patch alters the function to return XcmsFailure if the call to XGetWindowProperty fails. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2011-02-09xcms/LRGB: don't double-free property_returnAnder Conselvan de Oliveira1-1/+0
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 to free it again. Double free of pointer "property_return" in call to "free" 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>
2011-02-02Xrm.c: ReadInFile: refactor fstat error handlingAlan Coopersmith1-9/+4
We can simplify the fstat failure case now that the GetFileSize macro has been expanded inline. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-02-02Expand GetSizeOfFile() macro at the one place it's calledAlan Coopersmith3-49/+8
Removes XrmI.h header that only contained this single macro Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-02-01XlibInt: Use strncpy+zero termination instead of strcpy to enforce buffer sizeErkki Seppälä1-3/+4
Possible overrun of 8192 byte fixed size buffer "buffer" by copying "ext->name" without length checking 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-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-01xlibi18n/lcFile: Removed superfluous check for NULL target_dirErkki Seppälä1-4/+2
The situation is already handled before this code. Cannot reach dead expression "0U" inside statement "if (1U + (target_dir ? strl..." 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/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-01XlibInt: info_list->watch_data was reallocated, but result was discardedAnder Conselvan de Oliveira1-0/+1
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. 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: 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-01GetProp: Zero-initialized error so its resourceID field is initializedErkki Seppälä1-1/+1
Using uninitialized value "error.resourceID" in call to function "_XError" 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-01xcms/LRGB: Add a label for freeing property_return.Ander Conselvan de Oliveira1-14/+10
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: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-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-01xcms/LRGB: Fix potential resource leak.Ander Conselvan de Oliveira1-0/+2
property_return was not free'd if the allocation of pRedTbl failed. 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-01Xrm: Handle the extremely unlikely situation of fstat failingErkki Seppälä1-0/+6
Tracked variable "size" was passed to a negative sink. 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>