]> git.proxmox.com Git - mirror_lxc.git/commitdiff
getproctitle - check for null after last strchr
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 31 Jan 2015 13:09:47 +0000 (14:09 +0100)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 31 Jan 2015 13:10:22 +0000 (14:10 +0100)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/utils.c

index 8e84678c331f37d9d562d4cd9c2ab39b75bb1124..f730f0cd2ada5c7eb1d865ea455110cddb0801c8 100644 (file)
@@ -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;