Re: [Qemu-devel] [PATCH] virtio-crypto: fix possible integer and heap overflow

2017-01-08 Thread Gonglei (Arei)
Hi Michael, Ping... Regards, -Gonglei > -Original Message- > From: Gonglei (Arei) > Sent: Tuesday, January 03, 2017 2:50 PM > To: qemu-devel@nongnu.org > Cc: m...@redhat.com; liqiang...@360.cn; Gonglei (Arei); > qemu-sta...@nongnu.org > Subject: [PATCH] virtio-crypto: fix possible int

[Qemu-devel] [PATCH] virtio-crypto: fix possible integer and heap overflow

2017-01-02 Thread Gonglei
Because the 'size_t' type is 4 bytes in 32-bit platform, which is the same with 'int'. It's easy to make 'max_len' to zero when integer overflow and then cause heap overflow if 'max_len' is zero. Using uint_64 instead of size_t to avoid the integer overflow. Cc: qemu-sta...@nongnu.org Reported-by