Skip to content
Commit a08aaff8 authored by Gonglei's avatar Gonglei Committed by Michael S. Tsirkin
Browse files

virtio-crypto: fix possible integer and heap overflow



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-stable@nongnu.org
Reported-by: default avatarLi Qiang <liqiang6-s@360.cn>
Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Tested-by: default avatarLi Qiang <liqiang6-s@360.cn>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 8cdcf3c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment