params: avoid a core dump with a null pointer and a get string call
authorPauli <paul.dale@oracle.com>
Mon, 6 Apr 2020 01:53:10 +0000 (11:53 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 7 Apr 2020 23:14:17 +0000 (09:14 +1000)
commit86f32187c31fcff88253fcead04196563c04be09
tree7e0606ceb494a23dbbef7729afc6cf3e9eed26f6
parentc61ced5ec50fc68707c7cea79f7df1d170f03f13
params: avoid a core dump with a null pointer and a get string call

Previous a get string (UTF8 or octet) params call would memcpy(2) from a NULL
pointer if the OSSL_PARAM didn't have its data field set.  This change makes
the operation fail rather than core dump and it returns to param size (if set).

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11474)
crypto/params.c