summaryrefslogtreecommitdiffstats
path: root/source/xap/rdesktop/rdesktop-1.8.0-fix-missing-ui.diff
blob: efad2f33513379a859eaa428ed7db128d8b5e0e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From 8aeb027877c517510ea39c26c37c6dbd46401800 Mon Sep 17 00:00:00 2001
From: mancha <mancha1@hush.com>
Date: Sun, 20 Oct 2013
Subject: Fix crash with -P and/or -N

Make sure that ui is created if processing demand active PDU.

Relevant upstream revisions:
----------------------------
http://sourceforge.net/p/rdesktop/code/1731/
http://sourceforge.net/p/rdesktop/code/1732/
http://sourceforge.net/p/rdesktop/code/1741/

---
 proto.h    |    1 +
 rdesktop.c |   20 +++++++++++++-------
 rdp.c      |    3 +++
 3 files changed, 17 insertions(+), 7 deletions(-)

--- a/proto.h	2013-06-20
+++ b/proto.h	2013-10-20
@@ -144,6 +144,7 @@ RD_BOOL subprocess(char *const argv[], s
 char *l_to_a(long N, int base);
 int load_licence(unsigned char **data);
 void save_licence(unsigned char *data, int length);
+void rd_create_ui(void);
 RD_BOOL rd_pstcache_mkdir(void);
 int rd_open_file(char *filename);
 void rd_close_file(int fd);
--- a/rdesktop.c	2013-10-20
+++ b/rdesktop.c	2013-10-20
@@ -1132,13 +1132,7 @@ main(int argc, char *argv[])
 		DEBUG(("Connection successful.\n"));
 		memset(password, 0, sizeof(password));
 
-		/* only create a window if we dont have one intialized */
-		if (!ui_have_window())
-		{
-			if (!ui_create_window())
-				return EX_OSERR;
-		}
-
+		rd_create_ui();
 		tcp_run_ui(True);
 
 		g_redirect = False;
@@ -1732,6 +1726,18 @@ save_licence(unsigned char *data, int le
 	close(fd);
 }
 
+/* create rdesktop ui */
+void
+rd_create_ui()
+{
+	/* only create a window if we dont have one intialized */
+	if (!ui_have_window())
+	{
+		if (!ui_create_window())
+			exit(EX_OSERR);
+	}
+}
+
 /* Create the bitmap cache directory */
 RD_BOOL
 rd_pstcache_mkdir(void)
--- a/rdp.c	2013-06-20
+++ b/rdp.c	2013-10-20
@@ -1044,6 +1044,9 @@ process_demand_active(STREAM s)
 	uint8 type;
 	uint16 len_src_descriptor, len_combined_caps;
 
+	/* at this point we need to ensure that we have ui created */
+	rd_create_ui();
+
 	in_uint32_le(s, g_rdp_shareid);
 	in_uint16_le(s, len_src_descriptor);
 	in_uint16_le(s, len_combined_caps);