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:30:50 +0000 (19:30 -0500)
commitfd1ea63f9fcababfc4d4ea38ad5dd49a76fa6023
tree12077f3ab342d47d6734521eaf3db021dbc31695
parentf4cdd19a6a8a0845c08c8101538347f2d5a0d96c
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)

(cherry picked from commit b1498c98f3fb5b8a340acc9ce20b0fd5346294e5)
crypto/aes/aes_ige.c
crypto/modes/cbc128.c