mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-26 22:50:06 +01:00
Check for calloc() failure in add_master()
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9fc19168e7)
This commit is contained in:
parent
f11c5938d7
commit
157cc02fc1
1 changed files with 4 additions and 0 deletions
|
|
@ -143,6 +143,10 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
|
|||
int rc;
|
||||
|
||||
name = calloc(c->name_len + 1, sizeof(char));
|
||||
if (name == NULL) {
|
||||
rc = BadAlloc;
|
||||
goto unwind;
|
||||
}
|
||||
strncpy(name, (char *) &c[1], c->name_len);
|
||||
|
||||
rc = AllocDevicePair(client, name, &ptr, &keybd,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue