diff options
author | Graeme Perrow <graeme.perrow@sap.com> | 2015-02-12 13:00:42 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-02-12 13:00:42 -0500 |
commit | b0333e697c008d639c56f48e9148cb8cba957e32 (patch) | |
tree | a5767c97a9162bbeb5e30b2df3e1ce20fbc7ae46 /crypto/conf | |
parent | 5006c32253483ba232dd441c28624801195cd7b5 (diff) | |
download | openssl-b0333e697c008d639c56f48e9148cb8cba957e32.zip openssl-b0333e697c008d639c56f48e9148cb8cba957e32.tar.gz openssl-b0333e697c008d639c56f48e9148cb8cba957e32.tar.bz2 |
RT3670: Check return from BUF_MEM_grow_clean
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_def.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 59053e8..c8744e6 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++); |