Skip to content

Commit

Permalink
coverity: #1438067
Browse files Browse the repository at this point in the history
Explicit null dereferenced

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
  • Loading branch information
2xsec committed Jul 21, 2018
1 parent 280cc35 commit 18d4ffd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lxc/attach.c
Expand Up @@ -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';
Expand Down

0 comments on commit 18d4ffd

Please sign in to comment.