From: 2xsec Date: Sat, 21 Jul 2018 13:47:08 +0000 (+0900) Subject: coverity: #1438067 X-Git-Tag: lxc-3.1.0~197^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2486%2Fhead;p=thirdparty%2Flxc.git coverity: #1438067 Explicit null dereferenced Signed-off-by: 2xsec --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 5fe25429e..6fa53ebb4 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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';