qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v3 4/4] qcow2: Avoid memory over-allocation on c


From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH v3 4/4] qcow2: Avoid memory over-allocation on compressed images
Date: Thu, 22 Feb 2018 17:23:23 +0100
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Thu 22 Feb 2018 04:59:22 PM CET, Eric Blake wrote:
>          sector_offset = coffset & 511;
>          csize = nb_csectors * 512 - sector_offset;
           [...]
> +        assert(csize < 2 * s->cluster_size);

I think it should be <=

If sector_offset is 0 and nb_csector is the maximum allowed value then
csize is exactly 2 * s->cluster_size bytes.

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]