On Thu, Jul 08, 2010 at 08:45:45AM -0700, Keith Packard wrote: > On Thu, 8 Jul 2010 15:00:33 +0100, Daniel Stone <dan...@fooishbar.org> wrote: > > > + if (strncmp(s, "XF86_", 5) == 0) { > > + KeySym ret; > > + char *tmp = strdup(s); > > Please check malloc returns in Xlib... > > Otherwise, > > Reviewed-by: Keith Packard <kei...@keithp.com>
Jesus, how embarassment. Is the following OK? Cheers, Daniel From ee7708ddf8f3f7025ded7d5e60855826e7c2bb16 Mon Sep 17 00:00:00 2001 From: Daniel Stone <dan...@fooishbar.org> Date: Thu, 8 Jul 2010 16:49:51 +0100 Subject: [PATCH] XStringToKeysym: Check strdup() return value Signed-off-by: Daniel Stone <dan...@fooishbar.org> Reviewed-by: Keith Packard <kei...@keithp.com> --- src/StrKeysym.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/StrKeysym.c b/src/StrKeysym.c index f502de1..4bed94b 100644 --- a/src/StrKeysym.c +++ b/src/StrKeysym.c @@ -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); -- 1.7.1
signature.asc
Description: Digital signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel