summaryrefslogtreecommitdiffstats
path: root/crypto/conf
diff options
context:
space:
mode:
authorGraeme Perrow <graeme.perrow@sap.com>2015-02-12 13:00:42 -0500
committerRich Salz <rsalz@openssl.org>2015-02-12 13:01:33 -0500
commitee1ccd0a41ad068957fe65ba7521e593b51bbad4 (patch)
tree77183f5237932de9e3d1fabf2cfec6f17e15f433 /crypto/conf
parent62bfff2d99a59bdc2ae8cb8764deab4ec026c70b (diff)
RT3670: Check return from BUF_MEM_grow_clean
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit b0333e697c008d639c56f48e9148cb8cba957e32)
Diffstat (limited to 'crypto/conf')
-rw-r--r--crypto/conf/conf_def.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index e3ffeb21ef..faca9aeb57 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -585,7 +585,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++);