Skip to content
Snippets Groups Projects
  1. Feb 02, 2025
  2. Jan 11, 2025
  3. Jan 10, 2025
  4. Dec 30, 2024
  5. Dec 14, 2024
    • Wismill's avatar
      Fix misuse of UCSConvertCase in XConvertCase · 7c75a066
      Wismill authored
      There are two issues with the use of `UCSConvertCase` in `XConvertCase`:
      
      - Some Latin-1 keysyms do not map within Latin-1, e.g. `ssharp`.
        Only Latin-1 keysyms have the same value as the Unicode code point of
        their corresponding character. So `UCSConvertCase` does not work for
        some Latin-1 keysyms as it returns Unicode code points outside Latin-1
        that do not match their corresponding keysyms values.
      - Some Unicode keysyms should map to Latin-1 keysyms (<0x100). But the
        Unicode keysym mask 0x01000000 is applied blindly to the result of
        `UCSConvertCase`, resulting in invalid Unicode keysyms (0x010000nn)
        while they should be Latin-1 keysyms.
      
      Example with ß/ẞ:
      
      ```c
      KeySym lower, upper;
      
      XConvertCase(XK_ssharp, &lower, &upper);
      // Expected: lower == XK_ssharp, upper == U1E9E
      // Got:      lower == XK_ssharp, upper == 0x1E9E
      
      XConvertCase(U1E9E, &lower, &upper);
      // Expected: lower == XK_ssharp, upper == U1E9E
      // Got:      lower == 0x10000df, upper == U1E9E
      ```
      
      Part-of: <!274>
      7c75a066
  6. Nov 16, 2024
  7. Nov 11, 2024
  8. Nov 10, 2024
  9. Nov 04, 2024
    • Julien Cristau's avatar
      ximcp: hide internal functions · 8703ecf1
      Julien Cristau authored and Marge Bot's avatar Marge Bot committed
      commit 13e9ac4d "ximcp: Unmark to fabricate key events with XKeyEvent
      serial" added new _XimFabricateSerial / _XimUnfabricateSerial /
      _XimIsFabricatedSerial functions; they don't need to be exported by
      libX11.
      
      Part-of: <!271>
      8703ecf1
  10. Oct 26, 2024
  11. Oct 12, 2024
  12. Sep 29, 2024
    • Alan Coopersmith's avatar
      _XimStrConversionCallback: use size_t to calculate size to malloc · f2ebbce6
      Alan Coopersmith authored
      
      Avoids build failures with gcc 14.2 when MALLOC_0_RETURNS_NULL is defined:
      
      imCallbk.c:346:9: error: ‘memcpy’ offset 10 is out of the bounds [0, 1]
       [-Werror=array-bounds=]
        346 |         memcpy(&buf[p],&cbrec.text->string.mbs,length_in_bytes);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Part-of: <!267>
      f2ebbce6
    • Alan Coopersmith's avatar
      _XimEncodingNegotiation: swap order of arguments to calloc · 75c5bdee
      Alan Coopersmith authored
      
      Avoids build failures with gcc 14.2 when MALLOC_0_RETURNS_NULL is defined:
      
      imDefIm.c: In function ‘_XimEncodingNegotiation’:
      imDefIm.c:1739:15: error: ‘memcpy’ offset 8 is out of the bounds [0, 1]
       [-Werror=array-bounds=]
       1739 |         (void)memcpy((char *)&buf_s[2], name_ptr, name_len);
            |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Part-of: <!267>
      75c5bdee
    • Alan Coopersmith's avatar
      _XlcDefaultMapModifiers: remove conversions between size_t & int · 1f01aafa
      Alan Coopersmith authored
      
      Avoids build failures with gcc 14.2 when MALLOC_0_RETURNS_NULL is defined:
      
      lcWrap.c: In function ‘_XlcDefaultMapModifiers’:
      lcWrap.c:149:9: warning: ‘strcpy’ writing between 4294967296 and
       9223372036854775806 bytes into a region of size 1 [-Wstringop-overflow=]
        149 |         strcpy(mods, prog_mods);
            |         ^~~~~~~~~~~~~~~~~~~~~~~
      ../../include/X11/Xlibint.h:457:24: note: destination object of size 1
       allocated by ‘malloc’
        457 | # define Xmalloc(size) malloc((size_t)((size) == 0 ? 1 : (size)))
            |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      lcWrap.c:147:12: note: in expansion of macro ‘Xmalloc’
        147 |     mods = Xmalloc(i);
            |            ^~~~~~~
      lcWrap.c:149:9: error: ‘__builtin_memcpy’ forming offset [1, 4294967295]
       is out of the bounds [0, 1] [-Werror=array-bounds=]
        149 |         strcpy(mods, prog_mods);
            |         ^~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Part-of: <!267>
      1f01aafa
  13. Aug 31, 2024
  14. Aug 09, 2024
    • Olivier Fourdan's avatar
      Fix indentation · 19b2f5c2
      Olivier Fourdan authored
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Part-of: <!264>
      19b2f5c2
    • Olivier Fourdan's avatar
      Close xcb connection after freeing display structure · f3d6ebac
      Olivier Fourdan authored
      
      Commit 1472048b to fix a colormap threading issue added a display
      lock/unlock and a call to SyncHandle() to _XcmsFreeClientCmaps().
      
      When running synchronized, that means calling XSync().
      
      _XcmsFreeClientCmaps() is called from _XFreeDisplayStructure() via
      XCloseDisplay() after the xcb connection is closed.
      
      So when running synchronized, we may end up calling XSync() after the
      xcb connection to the display is closed, which will generate a spurious
      XIO error:
      
        | #0 in _XDefaultIOError () at /lib64/libX11.so.6
        | #1 in _XIOError () at /lib64/libX11.so.6
        | #2 in _XReply () at /lib64/libX11.so.6
        | #3 in XSync () at /lib64/libX11.so.6
        | #4 in _XSyncFunction () at /lib64/libX11.so.6
        | 8#5 in _XFreeDisplayStructure () at /lib64/libX11.so.6
        | 8#6 in XCloseDisplay () at /lib64/libX11.so.6
      
      To avoid that issue, closed the xcb connection to the display last.
      
      v2: And same in OutOfMemory() as well (José Expósito)
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarJosé Expósito <jexposit@redhat.com>
      Part-of: <!264>
      f3d6ebac
  15. Jul 28, 2024
  16. Jul 23, 2024
  17. Jul 20, 2024
  18. Jul 13, 2024
  19. Jul 06, 2024
  20. Jun 24, 2024
    • Olivier Fourdan's avatar
      Fix deadlock in XRebindKeysym() · 751fbc59
      Olivier Fourdan authored
      
      Xlib is now built with threading support enabled from the constructor
      by default.
      
      XRebindKeysym() acquires the display lock, then calls:
      
      | XRebindKeysym()
      |  LockDisplay()
      |  ComputeMaskFromKeytrans()
      |    -> XkbKeysymToModifiers()
      |        -> _XkbLoadDpy()
      |            -> XkbGetMap()
      |                -> XkbGetUpdatedMap()
      |                   LockDisplay()
      
      And the dead lock:
      
      | Xlib ERROR: XKBGetMap.c line 575 thread 1fc6e580: locking display already
      | locked at KeyBind.c line 937
      
      To avoid the issue, call ComputeMaskFromKeytrans() from outside the display
      lock.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Closes: xorg/lib/libx11#216
      Part-of: <xorg/lib/libx11!256>
      751fbc59
  21. Jun 18, 2024
  22. Jun 15, 2024
Loading