Allow strings in params to be of zero length
Sometimes it is useful to be able to pass NULL/zero length strings Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10152)
This commit is contained in:
parent
b3f3ba7011
commit
46ef075a99
1 changed files with 3 additions and 0 deletions
|
@ -776,6 +776,9 @@ static int get_string_internal(const OSSL_PARAM *p, void **val, size_t max_len,
|
|||
if (used_len != NULL)
|
||||
*used_len = sz;
|
||||
|
||||
if (sz == 0)
|
||||
return 1;
|
||||
|
||||
if (*val == NULL) {
|
||||
char *const q = OPENSSL_malloc(sz);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue