X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fconf%2Fconf_def.c;h=c8744e67088e6047b325e300bdc9cd08a1992478;hp=cdded0d6b59262c9b1763afe04ac0be96a08693c;hb=b0333e697c008d639c56f48e9148cb8cba957e32;hpb=0f113f3ee4d629ef9a4a30911b22b224772085e5 diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index cdded0d6b5..c8744e6708 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -384,25 +384,10 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) } } else tv = sv; -#if 1 if (_CONF_add_string(conf, tv, v) == 0) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } -#else - v->section = tv->section; - if (!sk_CONF_VALUE_push(ts, v)) { - CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } - vv = (CONF_VALUE *)lh_insert(conf->data, v); - if (vv != NULL) { - sk_CONF_VALUE_delete_ptr(ts, vv); - OPENSSL_free(vv->name); - OPENSSL_free(vv->value); - OPENSSL_free(vv); - } -#endif v = NULL; } } @@ -567,16 +552,16 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from) } e++; } - /*- - * So at this point we have - * np which is the start of the name string which is - * '\0' terminated. - * cp which is the start of the section string which is - * '\0' terminated. - * e is the 'next point after'. - * r and rr are the chars replaced by the '\0' - * rp and rrp is where 'r' and 'rr' came from. - */ + /*- + * So at this point we have + * np which is the start of the name string which is + * '\0' terminated. + * cp which is the start of the section string which is + * '\0' terminated. + * e is the 'next point after'. + * r and rr are the chars replaced by the '\0' + * rp and rrp is where 'r' and 'rr' came from. + */ p = _CONF_get_string(conf, cp, np); if (rrp != NULL) *rrp = rr; @@ -585,7 +570,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from) CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_HAS_NO_VALUE); goto err; } - BUF_MEM_grow_clean(buf, (strlen(p) + buf->length - (e - from))); + if (!BUF_MEM_grow_clean(buf, + (strlen(p) + buf->length - (e - from)))) { + CONFerr(CONF_F_STR_COPY, ERR_R_MALLOC_FAILURE); + goto err; + } while (*p) buf->data[to++] = *(p++);