/[pkg-src]/trunk/xorg-server/patches/xorg-server-1.17.1-v2-xserver-fix-a-crash-with-xdmcp-error-handler.patch |
Contents of /trunk/xorg-server/patches/xorg-server-1.17.1-v2-xserver-fix-a-crash-with-xdmcp-error-handler.patch
Parent Directory | Revision Log
Revision 2576 -
(show annotations)
(download)
Mon Jun 15 13:02:17 2015 UTC (9 years, 3 months ago) by niro
File size: 750 byte(s)
Mon Jun 15 13:02:17 2015 UTC (9 years, 3 months ago) by niro
File size: 750 byte(s)
-fixed garbage patches
1 | diff --git a/os/xdmcp.c b/os/xdmcp.c |
2 | index b6e97c9..0e9e625 100644 |
3 | --- a/os/xdmcp.c |
4 | +++ b/os/xdmcp.c |
5 | @@ -1409,8 +1409,16 @@ recv_alive_msg(unsigned length) |
6 | static void |
7 | XdmcpFatal(const char *type, ARRAY8Ptr status) |
8 | { |
9 | - FatalError("XDMCP fatal error: %s %*.*s\n", type, |
10 | - status->length, status->length, status->data); |
11 | + char *error_message; |
12 | + |
13 | + /* error_message is leaked, but that's fine, we're aborting */ |
14 | + error_message = malloc (status->length + 1); |
15 | + if (!error_message) |
16 | + FatalError("XDMCP fatal error: %s", type); |
17 | + |
18 | + memcpy(error_message, status->data, status->length); |
19 | + error_message[status->length] = '\0'; |
20 | + FatalError("XDMCP fatal error: %s %s\n", type, error_message); |
21 | } |
22 | |
23 | static void |