Skip to content
Snippets Groups Projects
  1. Jan 03, 2023
    • yshui's avatar
      Revert "Update XPutBackEvent() to support clients that put back unpadded events" · 88399e01
      yshui authored
      
      This reverts commit d6d6cba9.
      
      The reverted commit intended to fix the problem where an unpadded X
      event struct is passed into XPutBackEvent, by creating a padded struct
      with _XEventToWire and _XWireToEvent. However, _XWireToEvent updates the
      last sequence number in Display, which may cause xlib to complain about
      lost sequence numbers.
      
      IMO, the problem that commit tried to solve is a bug in the client
      library, and workaround it inside Xlib is bad practice, especially given
      the problem it caused. Plus, the offender cited in the original commit
      message, freeglut, has already fixed this problem.
      
      Fixes: #176 #174
      
      Signed-off-by: default avatarYuxuan Shui <yshuiv7@gmail.com>
      88399e01
  2. Dec 15, 2022
  3. Dec 11, 2022
    • Keith Packard's avatar
      Update XPutBackEvent() to support clients that put back unpadded events · d6d6cba9
      Keith Packard authored and Jeremy Huddleston Sequoia's avatar Jeremy Huddleston Sequoia committed
      
      It seems to be common practice of some X11 clients to pass specific event
      types into APIs that take XEvent*.  For example, freeglut does:
      
         XConfigureEvent fakeEvent = {0};
         ...
         XPutBackEvent(fgDisplay.Display, (XEvent*)&fakeEvent);
      
      This can result in reads overflowing the input event when libX11 does:
      
         XEvent store = *event;
      
      =================================================================
      ==75304==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x00016ee4a8e8 at pc 0x000101c54d14 bp 0x00016ee4a0d0 sp 0x00016ee49888
      READ of size 192 at 0x00016ee4a8e8 thread T0
          #0 0x101c54d10 in __asan_memcpy+0x1a4 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3cd10)
          #1 0x102848a18 in _XPutBackEvent PutBEvent.c:41
          #2 0x1028490a4 in XPutBackEvent PutBEvent.c:84
          #3 0x1013295c8 in fgOpenWindow freeglut_window.c:1178
          #4 0x101321984 in fgCreateWindow freeglut_structure.c:108
          #5 0x10132b138 in glutCreateWindow freeglut_window.c:1551
          #6 0x100fb7d94 in main+0x78 (checkeredTriangles:arm64+0x100003d94)
          #7 0x197de3e4c  (<unknown module>)
      
      Address 0x00016ee4a8e8 is located in stack of thread T0 at offset 840 in frame
          #0 0x1013282f8 in fgOpenWindow freeglut_window.c:1063
      
        This frame has 8 object(s):
          [32, 40) 'title.addr'
          [64, 176) 'winAttr' (line 1066)
          [208, 240) 'textProperty' (line 1067)
          [272, 352) 'sizeHints' (line 1068)
          [384, 440) 'wmHints' (line 1069)
          [480, 672) 'eventReturnBuffer' (line 1070)
          [736, 740) 'num_FBConfigs' (line 1072)
          [752, 840) 'fakeEvent' (line 1074) <== Memory access at offset 840 overflows this variable
      
      This change allows XPutBackEvent() to support such clients without
      risk of memory read overflow.
      
      Reviewed-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Tested-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Unverified
      d6d6cba9
    • Jeremy Huddleston Sequoia's avatar
      ximcp: Address warning found by UBSan when growing an empty tree · 496d9bfe
      Jeremy Huddleston Sequoia authored
      
      imLcPrs.c:681:52: runtime error: applying zero offset to null pointer
      
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Unverified
      496d9bfe
  4. Dec 06, 2022
  5. Dec 01, 2022
  6. Nov 19, 2022
  7. Nov 11, 2022
  8. Nov 10, 2022
  9. Nov 07, 2022
  10. Nov 03, 2022
  11. Nov 02, 2022
    • Benno Schulenberg's avatar
      nls: reshuffle a few compose sequences, to have similar ones together · 5e41119d
      Benno Schulenberg authored and Alan Coopersmith's avatar Alan Coopersmith committed
      It makes more sense to have similar sequences grouped together
      than to rigidly follow the order of ascending Unicode codes.
      5e41119d
    • Benno Schulenberg's avatar
      nls: remove two compose sequences that use deprecated symbols · 65d89342
      Benno Schulenberg authored and Alan Coopersmith's avatar Alan Coopersmith committed
      The last few occurrences of `leftcaret` and `rightcaret` were replaced
      with `less` and `greater` in xkeyboard-config half a year ago.
      65d89342
    • Benno Schulenberg's avatar
      nls: let `<Multi_key> <minus> <underscore>` compose U+2212 (MINUS SIGN) · 6baccbae
      Benno Schulenberg authored and Alan Coopersmith's avatar Alan Coopersmith committed
      There was not yet any way to compose the Unicode minus sign, U+2212.
      6baccbae
    • Adam Jackson's avatar
      Allow X*IfEvent() to reenter libX11 · 79775575
      Adam Jackson authored and Adam Jackson's avatar Adam Jackson committed
      The documentation for this family of functions very clearly says not to
      call into xlib in your predicate function, but historically single
      threaded apps could get away with it just fine, and now that we've
      forced thread-safety on the world such apps will now deadlock instead.
      That's not an acceptable regression even if the app is technically
      broken. This has been reported with XFCE and FVWM, and Motif's
      cut-and-paste code has the same bug by inspection, so this does need to
      be addressed.
      
      This change nerfs LockDisplay/UnlockDisplay while inside the critical
      bit of an IfEvent function. This is still safe in the sense that the
      display remains locked and no other thread should be able to change it
      from under us, but the loop that scans the event queue might not be
      robust against it being modified as a side effect of protocol emitted by
      the predicate callback. But that's not new, non-XInitThreads'd xlib
      would have the same caveat.
      
      Closes: #157
      79775575
  12. Oct 31, 2022
  13. Oct 20, 2022
    • Jan Tojnar's avatar
      nls: Map sr locales to sr_RS compose files · 31089827
      Jan Tojnar authored
      Serbian used sr_YU (Yugoslavia) code in the past.
      Then it was succeeded by sr_CS (Serbia and Montenegro).
      Finally, it was split into sr_RS (Serbia) and sr_ME (Montenegro).
      
      da95ecbb
      introduced the modern sr_RS and sr_ME codes.
      
      Next, 40761898
      added the Serbian compose table but only for the legacy sr_CS entry.
      
      5cd60398
      removed the legacy sr_CS entry, the only one pointing to the correct compose file.
      It also renamed the file to sr_RS, but did not update the compose mapping.
      
      Let’s point all Serbian locales to the Compose file again.
      31089827
  14. Oct 14, 2022
  15. Oct 08, 2022
  16. Oct 04, 2022
    • Thomas E. Dickey's avatar
      fix a memory leak in XRegisterIMInstantiateCallback · 1d118226
      Thomas E. Dickey authored
      
      Analysis:
      
          _XimRegisterIMInstantiateCallback() opens an XIM and closes it using
          the internal function pointers, but the internal close function does
          not free the pointer to the XIM (this would be done in XCloseIM()).
      
      Report/patch:
      
          Date: Mon, 03 Oct 2022 18:47:32 +0800
          From: Po Lu <luangruo@yahoo.com>
          To: xorg-devel@lists.x.org
          Subject: Re: Yet another leak in Xlib
      
          For reference, here's how I'm calling XRegisterIMInstantiateCallback:
      
          XSetLocaleModifiers ("");
          XRegisterIMInstantiateCallback (compositor.display,
                                          XrmGetDatabase (compositor.display),
                                          (char *) compositor.resource_name,
                                          (char *) compositor.app_name,
                                          IMInstantiateCallback, NULL);
      
          and XMODIFIERS is:
      
              @im=ibus
      
      Signed-off-by: default avatarThomas E. Dickey <dickey@invisible-island.net>
      Verified
      1d118226
  17. Sep 27, 2022
  18. Sep 11, 2022
  19. Sep 10, 2022
  20. Sep 08, 2022
  21. Aug 05, 2022
  22. Jul 25, 2022
  23. Jul 15, 2022
Loading