From 09bb3626646f285a3c00c9d424df3028dba9a10b Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Wed, 26 Nov 2025 07:49:05 +0000 Subject: [PATCH] restore: fix "Defect type: UNINIT" Static code analysis reported: 1. criu/cr-restore.c:2438:2: var_decl: Declaring variable "end_vma" without initializer. 4. criu/cr-restore.c:2451:5: assign: Assigning: "s_vma" = "&end_vma", which points to uninitialized data. 7. criu/cr-restore.c:2449:4: uninit_use: Using uninitialized value "s_vma->list.next". This tries to fix it by initializing the variable. Signed-off-by: Adrian Reber --- criu/cr-restore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 057ec0e93..a5eda8d60 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -2440,6 +2440,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list, struct list_he end_vma.e = &end_e; end_e.start = end_e.end = kdat.task_size; + INIT_LIST_HEAD(&end_vma.list); s_vma = list_first_entry(self_vma_list, struct vma_area, list); t_vma = list_first_entry(tgt_vma_list, struct vma_area, list);