Skip to content

Commit

Permalink
Merge pull request #2403 from 2xsec/coverity1
Browse files Browse the repository at this point in the history
coverity: #1425778
  • Loading branch information
brauner committed Jun 14, 2018
2 parents 40f3bd6 + 40229e9 commit 48cfd5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lxc/criu.c
Expand Up @@ -1314,7 +1314,11 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
SYSERROR("read");
n = 0;
}
buf[n] = 0;

if (n == sizeof(buf))
buf[n-1] = 0;
else
buf[n] = 0;

if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
Expand Down

0 comments on commit 48cfd5d

Please sign in to comment.