Don't call memcpy if len is zero.
authorRich Salz <rsalz@openssl.org>
Tue, 21 Feb 2017 00:17:53 +0000 (19:17 -0500)
committerRich Salz <rsalz@openssl.org>
Tue, 21 Feb 2017 00:17:53 +0000 (19:17 -0500)
commitb1498c98f3fb5b8a340acc9ce20b0fd5346294e5
treef309540be655ed567f17a6e48aa0e51aee63c79f
parentd913a0557f040e54120d028ced0a29767f7b12bb
Don't call memcpy if len is zero.

Prevent undefined behavior in CRYPTO_cbc128_encrypt: calling this function
with the 'len' parameter being 0 would result in a memcpy where the source
and destination parameters are the same, which is undefined behavior.
Do same for AES_ige_encrypt.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2671)
crypto/aes/aes_ige.c
crypto/modes/cbc128.c