]> Git Repo - qemu.git/commit
virtio-crypto: fix possible integer and heap overflow
authorGonglei <[email protected]>
Tue, 3 Jan 2017 06:50:03 +0000 (14:50 +0800)
committerMichael S. Tsirkin <[email protected]>
Tue, 10 Jan 2017 03:56:58 +0000 (05:56 +0200)
commita08aaff811fb194950f79711d2afe5a892ae03a4
tree4e7cc30b7d82c0494e7ae3dfdde88b69be332736
parent8cdcf3c1e58d04b6811956d7608efeb66c42d719
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: [email protected]
Reported-by: Li Qiang <[email protected]>
Signed-off-by: Gonglei <[email protected]>
Tested-by: Li Qiang <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/virtio/virtio-crypto.c
This page took 0.031571 seconds and 4 git commands to generate.