summaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-crypto.c
diff options
context:
space:
mode:
authorRahul Dadhich <r.dadhich@samsung.com>2018-06-13 15:08:07 +0530
committerRahul Dadhich <r.dadhich@samsung.com>2018-06-13 15:13:56 +0530
commitdc3848011053d7d8dd4eff5b1d4147dbd59b78ca (patch)
tree851d4c08b959f5583f3c7c04fc32fbe39f34b8fc /hw/virtio/virtio-crypto.c
parentf998471ef950dc559a40c902e8debfa131579d8e (diff)
downloadqemu-dc3848011053d7d8dd4eff5b1d4147dbd59b78ca.tar.gz
qemu-dc3848011053d7d8dd4eff5b1d4147dbd59b78ca.tar.bz2
qemu-dc3848011053d7d8dd4eff5b1d4147dbd59b78ca.zip
[SATDEVKIT-786]Open source security issues fix
Change-Id: If3c955c4ff33114725dde8f38c118e0a25387727 Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
Diffstat (limited to 'hw/virtio/virtio-crypto.c')
-rw-r--r--hw/virtio/virtio-crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 2f2467e859..c23e1ad458 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -416,7 +416,7 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev,
uint32_t hash_start_src_offset = 0, len_to_hash = 0;
uint32_t cipher_start_src_offset = 0, len_to_cipher = 0;
- size_t max_len, curr_size = 0;
+ uint64_t max_len, curr_size = 0;
size_t s;
/* Plain cipher */
@@ -441,7 +441,7 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev,
return NULL;
}
- max_len = iv_len + aad_len + src_len + dst_len + hash_result_len;
+ max_len = (uint64_t)iv_len + aad_len + src_len + dst_len + hash_result_len;
if (unlikely(max_len > vcrypto->conf.max_size)) {
virtio_error(vdev, "virtio-crypto too big length");
return NULL;