From: Serge Hallyn Date: Sat, 31 Jan 2015 13:09:47 +0000 (+0100) Subject: getproctitle - check for null after last strchr X-Git-Tag: lxc-1.1.1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=397a1b4bf553c8642b04cbb9e0176572afd26010;p=thirdparty%2Flxc.git getproctitle - check for null after last strchr Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 8e84678c3..f730f0cd2 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1596,6 +1596,9 @@ int setproctitle(char *title) tmp = strchr(tmp+1, ' '); } + if (!tmp) + return -1; + i = sscanf(tmp, "%lu %lu %lu %lu", &arg_start, &arg_end, &env_start, &env_end); if (i != 4) { return -1;