From: Tomas Mraz Date: Tue, 7 Jun 2022 12:16:30 +0000 (+0200) Subject: parse_unquoted: Check returned value from ossl_property_value() X-Git-Tag: openssl-3.2.0-alpha1~2545 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f91568eb50e847d0db2441fd9b9c5ffc8c4fe934;p=thirdparty%2Fopenssl.git parse_unquoted: Check returned value from ossl_property_value() Reviewed-by: Shane Lontis Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/18494) --- diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c index 1a78c5a4363..cdfe4777353 100644 --- a/crypto/property/property_parse.c +++ b/crypto/property/property_parse.c @@ -213,11 +213,10 @@ static int parse_unquoted(OSSL_LIB_CTX *ctx, const char *t[], return 0; } v[i] = 0; - if (err) { + if (err) ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t); - } else { - res->v.str_val = ossl_property_value(ctx, v, create); - } + else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0) + err = 1; *t = skip_space(s); res->type = OSSL_PROPERTY_TYPE_STRING; return !err;