Ensure we don't call memcpy with a NULL pointer
authorMatt Caswell <matt@openssl.org>
Fri, 3 Mar 2017 08:56:25 +0000 (08:56 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 3 Mar 2017 23:49:24 +0000 (23:49 +0000)
commitd08086645f72ab890c6ef996bb513076752431f0
treebf9be561e79ad2c673dac87ba874ff81bc17bfb4
parent8336ca13b1be5358621da075eac7a0ab5dc2bd10
Ensure we don't call memcpy with a NULL pointer

Commit d5aa14dd simplified the bn_expand_internal() and BN_copy() functions.
Unfortunately it also removed some checks which are still required,
otherwise we call memcpy passing in NULL which is not allowed.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2836)
crypto/bn/bn_lib.c