From 41c028be1988ad160ef2fa6feca4441bb4bca17d Mon Sep 17 00:00:00 2001 From: miod <> Date: Tue, 28 Oct 2014 05:46:56 +0000 Subject: Check the result of sk_*_push() operations for failure. ok doug@ jsing@ --- src/lib/libcrypto/store/str_mem.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/store/str_mem.c') diff --git a/src/lib/libcrypto/store/str_mem.c b/src/lib/libcrypto/store/str_mem.c index 3f32bcb8d0..a85a8946b7 100644 --- a/src/lib/libcrypto/store/str_mem.c +++ b/src/lib/libcrypto/store/str_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str_mem.c,v 1.9 2014/07/09 16:59:33 miod Exp $ */ +/* $OpenBSD: str_mem.c,v 1.10 2014/10/28 05:46:56 miod Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2003. */ @@ -250,7 +250,11 @@ mem_list_start(STORE *s, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], goto err; } } - sk_STORE_ATTR_INFO_push(context->search_attributes, attrs); + if (sk_STORE_ATTR_INFO_push(context->search_attributes, + attrs) == 0) { + STOREerr(STORE_F_MEM_LIST_START, ERR_R_MALLOC_FAILURE); + goto err; + } } if (!STORE_parse_attrs_endp(attribute_context)) goto err; -- cgit v1.2.3-55-g6feb