]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1438067
author2xsec <dh48.jeong@samsung.com>
Sat, 21 Jul 2018 13:47:08 +0000 (22:47 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 14:22:15 +0000 (15:22 +0100)
Explicit null dereferenced

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

index b873c6fc3b78e6d9dec50a9a81e20f0ba356f537..c4330895b8f03fa310c3b90db83b9a621c91dd08 100644 (file)
@@ -516,6 +516,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';