From b6efc51ef60d5aa4ee94a85ad7211ab51034407e Mon Sep 17 00:00:00 2001 Message-ID: From: Peter Krempa Date: Mon, 3 Feb 2025 18:23:29 +0100 Subject: [PATCH] qemuSnapshotForEachQcow2: Don't initialize 'nrollback' The variable holds the amount of disks to roll back the snapshot for. The value must be set before the code jumps to the 'rollback:' label so the best situation is to not initialize it and let the compiler catch errors rather than initialize the unsigned variable to -1 and let it crash. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina (cherry picked from commit d15eff63041ace067fa0ea9687c482a0f1dd140f) https://issues.redhat.com/browse/RHEL-73315 --- src/qemu/qemu_snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 80cd54bf33..7c998afe6f 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -290,7 +290,7 @@ qemuSnapshotForEachQcow2(virDomainDef *def, size_t i; bool skipped = false; bool create = STREQ(op, "-c"); - size_t nrollback = -1; + size_t nrollback; virErrorPtr orig_err; /* pre-checks */ -- 2.48.1