xserver: os/log.c: ignore alternate forms in log formats
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / Release pushed tag (push) Waiting to run

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 <oleh.nyk@gmail.com>
This commit is contained in:
Oleh Nykyforchyn 2025-07-29 16:12:50 +03:00 • committed by Enrico Weigelt
commit 0c23d26fb8

View file

@ -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++;