From 94ac9ee3cc9a53c5200ffc7c79ca7444e10cd09a Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Wed, 5 Apr 2023 13:58:18 +0800 Subject: [PATCH] proc_parse: fix while condition in parse_pid_status In parse_pid_status there are 13 places where we do done++, so when "done" is 13 it means that we have matched each of those 13 places and we are ready to stop. In next lines we are not going to find anything. So the right condition for the while loop is (done < 13). Signed-off-by: Pavel Tikhomirov --- criu/proc_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/proc_parse.c b/criu/proc_parse.c index bcb8256b4..5e96b5c96 100644 --- a/criu/proc_parse.c +++ b/criu/proc_parse.c @@ -1043,7 +1043,7 @@ int parse_pid_status(pid_t pid, struct seize_task_status *ss, void *data) if (bfdopenr(&f)) return -1; - while (done < 14) { + while (done < 13) { str = breadline(&f); if (str == NULL) break;