mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 01:31:34 +00:00
zdtm/dumpable02: don't print a non-null terminated string
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
a2a07874d1
commit
feff2efa9a
1 changed files with 2 additions and 1 deletions
|
|
@ -36,11 +36,12 @@ int get_dumpable_from_pipes(int pipe_input, int pipe_output) {
|
|||
/* input and output are from the child's point of view. */
|
||||
|
||||
write(pipe_input, "GET\n", 4);
|
||||
len = read(pipe_output, buf, sizeof(buf));
|
||||
len = read(pipe_output, buf, sizeof(buf) - 1);
|
||||
if (len < 0) {
|
||||
pr_perror("error in parent reading from pipe");
|
||||
return -1;
|
||||
}
|
||||
buf[len] = 0;
|
||||
|
||||
if (memcmp(buf, "DUMPABLE:", 9) != 0) {
|
||||
pr_perror("child returned [%s]", buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue