]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/evp/evp_enc.c
EVP_EncryptUpdate, EVP_EncryptFinal_ex: don't branch on uninitialized memory
authorGuido Vranken <guidovranken@gmail.com>
Fri, 3 May 2019 13:44:38 +0000 (15:44 +0200)
committerPauli <paul.dale@oracle.com>
Wed, 8 May 2019 01:02:36 +0000 (11:02 +1000)
commit36e619d70f86f9dd52c57b6ac8a3bfea3c0a2745
treeff9cf2adbd5f0d4a4519292218ee72f4ae1afb5e
parent0dc6bf3c39732aea7bc049d145c395bbec895f52
EVP_EncryptUpdate, EVP_EncryptFinal_ex: don't branch on uninitialized memory

If ctx->cipher->cupdate/ctx->cipher->cfinal failed, 'soutl' is left
uninitialized.

This patch incorporates the same logic as present in EVP_DecryptUpdate and
EVP_DecryptFinal_ex: only branch on 'soutl' if the preceding call succeeded.

Bug found by OSS-Fuzz.

Signed-off-by: Guido Vranken <guidovranken@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8874)
crypto/evp/evp_enc.c