From f91568eb50e847d0db2441fd9b9c5ffc8c4fe934 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 7 Jun 2022 14:16:30 +0200 Subject: [PATCH] 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) --- crypto/property/property_parse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; -- 2.47.2