crypto: assert that qcrypto_hash_digest_len is in range
commitb35c1f3361ebf6ec9ea5022903af4b559bff6063
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 May 2016 09:09:54 +0000 (20 11:09 +0200)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 13 Jun 2016 11:41:17 +0000 (13 12:41 +0100)
tree74a8cc5b6b93c0d682876e98ff8240f7c3d34ddc
parente7ed11f083015bf34a121cfff31540cf9c2bae23
crypto: assert that qcrypto_hash_digest_len is in range

Otherwise unintended results could happen.  For example,
Coverity reports a division by zero in qcrypto_afsplit_hash.
While this cannot really happen, it shows that the contract
of qcrypto_hash_digest_len can be improved.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
crypto/hash.c