mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-07 21:28:04 +02:00
XStringToKeysym: Check strdup() return value
Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
cffa71b4a5
commit
bea0873caf
1 changed files with 2 additions and 0 deletions
|
|
@ -159,6 +159,8 @@ XStringToKeysym(_Xconst char *s)
|
|||
if (strncmp(s, "XF86_", 5) == 0) {
|
||||
KeySym ret;
|
||||
char *tmp = strdup(s);
|
||||
if (!tmp)
|
||||
return NoSymbol;
|
||||
memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
|
||||
ret = XStringToKeysym(tmp);
|
||||
free(tmp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue