Skip to content

Copy locale modifiers when creating XimInstCallback

Keith Packard requested to merge keithp/libx11:use-after-free-locale-fix into master

Locale modifiers may be freed whenever XSetLocaleModifiers gets called, even if the locale hasn't changed. This means that we cannot save a pointer to those modifiers in the XimInstCallback record and must, instead, make a copy of them instead.

This fixes a problem uncovered when running wish under libasan as follows (on current Debian unstable):

$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6 wish

Reported-by: Vittorio Zecca zeccav@gmail.com Signed-off-by: Keith Packard keithp@keithp.com

Merge request reports