From: Graeme Perrow Date: Thu, 12 Feb 2015 18:00:42 +0000 (-0500) Subject: RT3670: Check return from BUF_MEM_grow_clean X-Git-Tag: OpenSSL_1_1_0-pre1~1646 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0333e697c008d639c56f48e9148cb8cba957e32;p=oweals%2Fopenssl.git RT3670: Check return from BUF_MEM_grow_clean Reviewed-by: Richard Levitte --- diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 59053e85bd..c8744e6708 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -570,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++);