File: misc-fixes.diff

package info (click to toggle)
xorgxrdp 1%3A0.10.4-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,796 kB
  • sloc: ansic: 13,458; sh: 4,630; asm: 2,332; makefile: 289
file content (44 lines) | stat: -rw-r--r-- 1,336 bytes parent folder | download | duplicates (4)
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
From: Thorsten Glaser <tg@mirbsd.org>
Subject: misc. fixes
Forwarded: https://github.com/neutrinolabs/xorgxrdp/pull/17
 https://github.com/neutrinolabs/xrdp/pull/467

--- a/xrdpkeyb/rdpKeyboard.c
+++ b/xrdpkeyb/rdpKeyboard.c
@@ -536,7 +536,7 @@ rdpInputKeyboard(rdpPtr dev, int msg, lo
 }
 
 /******************************************************************************/
-void
+int
 rdpkeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
 {
     int i;
@@ -567,7 +567,7 @@ rdpkeybDeviceInit(DeviceIntPtr pDevice,
     if (pKeySyms->map == 0)
     {
         LLOGLN(0, ("rdpkeybDeviceInit: out of memory"));
-        exit(1);
+        return 1;
     }
 
     for (i = 0; i < MAP_LENGTH * GLYPHS_PER_KEY; i++)
@@ -579,6 +579,8 @@ rdpkeybDeviceInit(DeviceIntPtr pDevice,
     {
         pKeySyms->map[i] = g_kbdMap[i];
     }
+
+    return 0;
 }
 
 /******************************************************************************/
@@ -687,7 +689,8 @@ rdpkeybControl(DeviceIntPtr device, int
     switch (what)
     {
         case DEVICE_INIT:
-            rdpkeybDeviceInit(device, &keySyms, modMap);
+            if (rdpkeybDeviceInit(device, &keySyms, modMap))
+                return BadAlloc;
             memset(&set, 0, sizeof(set));
             set.rules = g_base_str;
             set.model = g_pc104_str;