From 0c23d26fb84c6f9176945901d12a1bacbd02ea92 Mon Sep 17 00:00:00 2001 From: Oleh Nykyforchyn Date: Tue, 29 Jul 2025 16:12:50 +0300 Subject: [PATCH] xserver: os/log.c: ignore alternate forms in log formats This patch fixes Xserver crashes when evdev or synaptics input drivers are used. These (and maybe other) driver use alternate forms "%#..." in formats for xf86IDrvLogVerb() function, which in turn uses signal-safe vpnprintf(). The last function does not recognize alternate forms and exits abnormally, which causes Xserver to crash. The patch make vpnprintf() to ignore alternate forms. Signed-off-by: Oleh Nykyforchyn --- os/log.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os/log.c b/os/log.c index c0ff0ee931..82fc92e2e5 100644 --- a/os/log.c +++ b/os/log.c @@ -410,6 +410,10 @@ vpnprintf(char *string, int size_in, const char *f, va_list args) f_idx++; + if (f[f_idx] == '#') + /* silently ignore alternate form */ + f_idx++; + /* silently ignore reverse justification */ if (f[f_idx] == '-') f_idx++;