From 79e8592fb73fb3e6891966b5a10dc07f116e38df04faad138931d600f22ed5bb Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Mon, 9 Nov 2015 16:51:49 +0000 Subject: [PATCH] - u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch: Fix XDMCP fatal error printing to not crash do to not supported format string (boo#948713). OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=590 --- ...format-in-XDMCP-fatal-error-printing.patch | 36 +++++++++++++++++++ xorg-x11-server.changes | 7 ++++ xorg-x11-server.spec | 2 ++ 3 files changed, 45 insertions(+) create mode 100644 u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch diff --git a/u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch b/u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch new file mode 100644 index 0000000..da5a724 --- /dev/null +++ b/u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch @@ -0,0 +1,36 @@ +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 diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 3a954e5..9957e5f 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Nov 9 16:46:35 UTC 2015 - eich@suse.com + +- u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch: + Fix XDMCP fatal error printing to not crash do to not supported + format string (boo#948713). + ------------------------------------------------------------------- Wed Oct 28 17:32:07 UTC 2015 - sndirsch@suse.com diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cf9ab4d..24a20db 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -185,6 +185,7 @@ Patch201: U_linux-Add-linux_parse_vt_settings-and-linux_get_keep.patch Patch202: U_linux-Add-a-may_fail-paramter-to-linux_parse_vt_sett.patch Patch203: U_systemd-logind-Only-use-systemd-logind-integration-t.patch Patch204: U_systemd-logind-do-not-rely-on-directed-signals.patch +Patch205: u_XDMCP-Fix-format-in-XDMCP-fatal-error-printing.patch Patch1000: n_xserver-optimus-autoconfig-hack.patch @@ -282,6 +283,7 @@ cp %{SOURCE90} . %patch202 -p1 %patch203 -p1 %patch204 -p1 +%patch205 -p1 %patch1000 -p1