]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration/multifd: Fix loop conditions in multifd_zstd_send_prepare and multifd_zstd_recv
authorStefan Weil <sw@weilnetz.de>
Tue, 10 Sep 2024 05:41:38 +0000 (07:41 +0200)
committerPeter Xu <peterx@redhat.com>
Wed, 18 Sep 2024 18:27:24 +0000 (14:27 -0400)
commitcb0ed522a51a7d4b1fde535972d4aeeb82447928
tree3726927103ab1fa3f1fc3618c511eed70ed97f1c
parent561ce0149373ecab7fa123cb64ffd50155c06e10
migration/multifd: Fix loop conditions in multifd_zstd_send_prepare and multifd_zstd_recv

GitHub's CodeQL reports four critical errors which are fixed by this commit:

    Unsigned difference expression compared to zero

An expression (u - v > 0) with unsigned values u, v is only false if u == v,
so all changed expressions did not work as expected.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Link: https://lore.kernel.org/r/20240910054138.1458555-1-sw@weilnetz.de
[peterx: Fix mangled email for author]
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/multifd-zstd.c