From: Egbert Eich Date: Mon Nov 9 16:54:27 2015 +0100 Subject: [PATCH]XDMCP: Fix format in XDMCP fatal error printing Patch-mainline: to be upstreamed Git-commit: aefa0cadd72168ff7a41c79e547021edee27f53a Git-repo: git://anongit.freedesktop.org/git/xorg/xserver References: boo#948713 Signed-off-by: Egbert Eich XdmcpFatal() calls FatalError() with '%*.*s' in the format string. FatalError() however uses the async safe versions of printf() which only support a subset of the POSIX printf formats - they don't contain the '*' width and precision specifiers. Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=948713 Signed-off-by: Egbert Eich --- os/xdmcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/xdmcp.c b/os/xdmcp.c index 5bdcbe9..b53db1f 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -1403,8 +1403,9 @@ _X_NORETURN static void XdmcpFatal(const char *type, ARRAY8Ptr status) { - FatalError("XDMCP fatal error: %s %*.*s\n", type, - status->length, status->length, status->data); + char *msg = strndup((char *)status->data, status->length); + FatalError("XDMCP fatal error: %s %s\n", type, msg); + free(msg); } static void