From: 2xsec Date: Sat, 21 Jul 2018 13:47:08 +0000 (+0900) Subject: coverity: #1438067 X-Git-Tag: lxc-2.0.10~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a16d90b5e22aba2b6dc5cd00f08d6ff3f386ed5b;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 b873c6fc3..c4330895b 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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';