diff options
author | Richard Levitte <levitte@openssl.org> | 2021-02-23 08:10:02 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-02-24 19:50:10 +0100 |
commit | af8bd1d8359705c6a980c65b0c27c3e90fc43bea (patch) | |
tree | 9f99d4a68a7b986aa7a996978378d17fad967c7f /crypto/params_from_text.c | |
parent | Allow the sshkdf type to be passed as a single character (diff) | |
download | openssl-af8bd1d8359705c6a980c65b0c27c3e90fc43bea.tar.xz openssl-af8bd1d8359705c6a980c65b0c27c3e90fc43bea.zip |
Fix OSSL_PARAM_allocate_from_text() for OSSL_PARAM_UTF8_STRING
OSSL_PARAM_allocate_from_text() was still setting the length in bytes
of the UTF8 string to include the terminating NUL byte, while recent
changes excludes that byte from the length.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14035)
Diffstat (limited to 'crypto/params_from_text.c')
-rw-r--r-- | crypto/params_from_text.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/params_from_text.c b/crypto/params_from_text.c index b019744f9b..3ff94c7475 100644 --- a/crypto/params_from_text.c +++ b/crypto/params_from_text.c @@ -151,6 +151,8 @@ static int construct_from_text(OSSL_PARAM *to, const OSSL_PARAM *paramdef, #else strncpy(buf, value, buf_n); #endif + /* Don't count the terminating NUL byte as data */ + buf_n--; break; case OSSL_PARAM_OCTET_STRING: if (ishex) { |