Commit b414bc2c authored by Daniel Stone's avatar Daniel Stone Committed by Ulrich Sibiller

XStringToKeysym: Check strdup() return value

Signed-off-by: 's avatarDaniel Stone <daniel@fooishbar.org> Reviewed-by: 's avatarKeith Packard <keithp@keithp.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent c1b175d3
...@@ -159,6 +159,8 @@ XStringToKeysym(_Xconst char *s) ...@@ -159,6 +159,8 @@ XStringToKeysym(_Xconst char *s)
if (strncmp(s, "XF86_", 5) == 0) { if (strncmp(s, "XF86_", 5) == 0) {
KeySym ret; KeySym ret;
char *tmp = strdup(s); char *tmp = strdup(s);
if (!tmp)
return NoSymbol;
memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1); memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
ret = XStringToKeysym(tmp); ret = XStringToKeysym(tmp);
free(tmp); free(tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment