summarylogtreecommitdiffstats
path: root/v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch
diff options
context:
space:
mode:
authorMattias Andrée2015-06-11 18:07:46 +0200
committerMattias Andrée2015-06-11 18:07:46 +0200
commit04b9ce25138401ff00d21cd9a5615b073f44c142 (patch)
tree2965a268f808037f3248e801b98dfd8762bf89f2 /v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch
downloadaur-04b9ce25138401ff00d21cd9a5615b073f44c142.tar.gz
Initial import, version 1.17.1-6
Diffstat (limited to 'v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch')
-rw-r--r--v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch b/v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch
new file mode 100644
index 000000000000..02dbaf22f93f
--- /dev/null
+++ b/v2-xserver-Fix-a-crash-with-XDMCP-error-handler.patch
@@ -0,0 +1,23 @@
+diff --git a/os/xdmcp.c b/os/xdmcp.c
+index b6e97c9..0e9e625 100644
+--- a/os/xdmcp.c
++++ b/os/xdmcp.c
+@@ -1409,8 +1409,16 @@ recv_alive_msg(unsigned length)
+ static void
+ XdmcpFatal(const char *type, ARRAY8Ptr status)
+ {
+- FatalError("XDMCP fatal error: %s %*.*s\n", type,
+- status->length, status->length, status->data);
++ char *error_message;
++
++ /* error_message is leaked, but that's fine, we're aborting */
++ error_message = malloc (status->length + 1);
++ if (!error_message)
++ FatalError("XDMCP fatal error: %s", type);
++
++ memcpy(error_message, status->data, status->length);
++ error_message[status->length] = '\0';
++ FatalError("XDMCP fatal error: %s %s\n", type, error_message);
+ }
+
+ static void