[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] qcow2-cluster: Fix integer left shift error in qcow2_alloc_c
Re: [PATCH] qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
Wed, 05 Aug 2020 15:44:08 +0200
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)
On Wed 05 Aug 2020 11:22:58 AM CEST, Tuguoyi wrote:
> This patch fix it by casting @i to uint64_t before doing left shift
The patch seems fine and I also think that it's perhaps worth a test
case (although it only seems to happen with preallocation=falloc or full
so the test would need to generate very large files).
But I also wonder if there are other cases where this can happen.
nb_clusters is an int and there are more cases of
nb_clusters << s->cluster_bits
I can see at least these: handle_alloc(), qcow2_free_any_clusters(),