diff options
author | Matt Caswell <matt@openssl.org> | 2019-10-17 17:19:21 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-11-14 09:29:21 +0000 |
commit | 46ef075a99b3ea8e8bd5641405f745c43fdaefb2 (patch) | |
tree | ea3cb22d3f56824aeae80f0100014ffdb04fbdc8 /crypto | |
parent | b3f3ba7011c9afa3ac3b5ebf0c7462fb6ddee2cd (diff) |
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)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/params.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/params.c b/crypto/params.c index 58a4710e47..5d1fc6a6f2 100644 --- a/crypto/params.c +++ b/crypto/params.c @@ -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); |