Skip to content
Snippets Groups Projects
  1. Mar 08, 2025
  2. Feb 27, 2025
  3. Feb 23, 2025
  4. Feb 02, 2025
  5. Jan 11, 2025
  6. Jan 10, 2025
  7. Dec 30, 2024
  8. 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
  9. Nov 16, 2024
  10. Nov 11, 2024
  11. Nov 10, 2024
  12. 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
  13. Oct 26, 2024
  14. Oct 12, 2024
  15. 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
  16. Aug 31, 2024
  17. 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
  18. Jul 28, 2024
Loading