Fix dh_pub_encode
authorMatt Caswell <matt@openssl.org>
Wed, 11 Mar 2015 20:08:16 +0000 (20:08 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 12 Mar 2015 09:29:48 +0000 (09:29 +0000)
commit563fc239d23985f7e7a7300003bd8eb173224354
treec0e4d0c8ef3cedeea4b280b3666d78cd04a34b0d
parent15919ecadc3ba9fc210472b806e6ac258825ea83
Fix dh_pub_encode

The return value from ASN1_STRING_new() was not being checked which could
lead to a NULL deref in the event of a malloc failure. Also fixed a mem
leak in the error path.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 6aa8dab2bbfd5ad3cfc0d07fe5d7243635d5b2a2)
crypto/dh/dh_ameth.c