]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
pam_cgfs: make sure that **p is not NULL
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 9 Feb 2017 10:36:47 +0000 (11:36 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 9 Feb 2017 18:09:03 +0000 (19:09 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
pam/pam_cgfs.c

index a22d2f8e9dbdb42037621318cd8f08e1964b05fd..fd47d7076a2271a1997eb164c9fdf2a3d2a2e184 100644 (file)
@@ -1649,6 +1649,9 @@ static char *string_join(const char *sep, const char **parts, bool use_as_prefix
        size_t sep_len = strlen(sep);
        size_t result_len = use_as_prefix * sep_len;
 
+       if (!parts)
+               return NULL;
+
        /* calculate new string length */
        for (p = (char **)parts; *p; p++)
                result_len += (p > (char **)parts) * sep_len + strlen(*p);