]> git.proxmox.com Git - mirror_lxc.git/commitdiff
coverity: #1438067
author2xsec <dh48.jeong@samsung.com>
Sat, 21 Jul 2018 13:47:08 +0000 (22:47 +0900)
committer2xsec <dh48.jeong@samsung.com>
Sat, 21 Jul 2018 13:47:08 +0000 (22:47 +0900)
Explicit null dereferenced

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/attach.c

index 5fe25429e8f6ef5b5231a6cf3c02ddc5d13ba9fc..6fa53ebb4adb0b4a06a1d97ffa492f33fda56377 100644 (file)
@@ -534,6 +534,9 @@ static char *lxc_attach_getpwshell(uid_t uid)
                if (found)
                        continue;
 
+               if (!line)
+                       continue;
+
                /* Trim line on the right hand side. */
                for (i = strlen(line); i > 0 && (line[i - 1] == '\n' || line[i - 1] == '\r'); --i)
                        line[i - 1] = '\0';