Peter Xu <pet...@redhat.com> wrote:
> I would guess it won't happen normally, but this should ease Coverity.
>
>>>>     CID 1394385:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>>     Potentially overflowing expression "pages->used * 8192U" with
>>>> type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit
>>>> arithmetic, and then used in a context that expects an expression
>>>> of type "uint64_t" (64 bits, unsigned).
> 854         transferred = pages->used * TARGET_PAGE_SIZE + p->packet_len;
>
> Fixes: CID 1394385
> CC: Juan Quintela <quint...@redhat.com>
> Signed-off-by: Peter Xu <pet...@redhat.com>

Reviewed-by: Juan Quintela <quint...@redhat.com>

a - I hate C promotion rules
b - why gcc don't warn me
c - it don't matter.  If the size of the package is bigger than 4GB, we
    have other problems already.

Thanks, Juan.

Reply via email to