aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-12-12 20:34:06 +0000
committermarha <marha@users.sourceforge.net>2010-12-12 20:34:06 +0000
commitd3ae6e21a12209f5c8cb8c84ba0f68fb69736844 (patch)
tree62710b8524ebc7675ebd7f4976fd7f9530ce5df2 /xorg-server/dix/devices.c
parent0be679f7724e33c2761ebb67846707fb3351167b (diff)
parent3a20d23b48c1051e1f22295fd886cc7f643417f6 (diff)
downloadvcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.tar.gz
vcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.tar.bz2
vcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 6ef24feb1..1bf73b992 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2532,9 +2532,11 @@ AllocDevicePair (ClientPtr client, char* name,
if (!pointer)
return BadAlloc;
- pointer->name = calloc(strlen(name) + strlen(" pointer") + 1, sizeof(char));
- strcpy(pointer->name, name);
- strcat(pointer->name, " pointer");
+ if (asprintf(&pointer->name, "%s pointer", name) == -1) {
+ pointer->name = NULL;
+ RemoveDevice(pointer, FALSE);
+ return BadAlloc;
+ }
pointer->public.processInputProc = ProcessOtherEvent;
pointer->public.realInputProc = ProcessOtherEvent;
@@ -2555,9 +2557,12 @@ AllocDevicePair (ClientPtr client, char* name,
return BadAlloc;
}
- keyboard->name = calloc(strlen(name) + strlen(" keyboard") + 1, sizeof(char));
- strcpy(keyboard->name, name);
- strcat(keyboard->name, " keyboard");
+ if (asprintf(&keyboard->name, "%s keyboard", name) == -1) {
+ keyboard->name = NULL;
+ RemoveDevice(keyboard, FALSE);
+ RemoveDevice(pointer, FALSE);
+ return BadAlloc;
+ }
keyboard->public.processInputProc = ProcessOtherEvent;
keyboard->public.realInputProc = ProcessOtherEvent;