Fix some Coverity issues in sm2_encrypt()
authorMatt Caswell <matt@openssl.org>
Tue, 26 Jun 2018 14:10:56 +0000 (15:10 +0100)
committerMatt Caswell <matt@openssl.org>
Sat, 7 Jul 2018 13:00:19 +0000 (14:00 +0100)
commit1829ff4b5e7f1d1570ea9b9e4660a1a673e5da67
treef2345a1337ff5ad9addd131b771f32c3f27ae468
parent3e0076c213ec2d1149a9a89f9bc141d1a1a44630
Fix some Coverity issues in sm2_encrypt()

Check for a negative EVP_MD_size().
Don't dereference group until we've checked if it is NULL.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6592)
crypto/sm2/sm2_crypt.c