summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/store/str_mem.c6
-rw-r--r--lib/libcrypto/x509v3/pcy_tree.c6
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/libcrypto/store/str_mem.c b/lib/libcrypto/store/str_mem.c
index 4eb707c5a9d..3f32bcb8d09 100644
--- a/lib/libcrypto/store/str_mem.c
+++ b/lib/libcrypto/store/str_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: str_mem.c,v 1.8 2014/06/12 15:49:30 deraadt Exp $ */
+/* $OpenBSD: str_mem.c,v 1.9 2014/07/09 16:59:33 miod Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2003.
*/
@@ -224,15 +224,15 @@ static void *
mem_list_start(STORE *s, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
- struct mem_ctx_st *context = malloc(sizeof(struct mem_ctx_st));
+ struct mem_ctx_st *context;
void *attribute_context = NULL;
STORE_ATTR_INFO *attrs = NULL;
+ context = calloc(1, sizeof(struct mem_ctx_st));
if (!context) {
STOREerr(STORE_F_MEM_LIST_START, ERR_R_MALLOC_FAILURE);
return 0;
}
- memset(context, 0, sizeof(struct mem_ctx_st));
attribute_context = STORE_parse_attrs_start(attributes);
if (!attribute_context) {
diff --git a/lib/libcrypto/x509v3/pcy_tree.c b/lib/libcrypto/x509v3/pcy_tree.c
index 8627429d6c0..aaf27e98024 100644
--- a/lib/libcrypto/x509v3/pcy_tree.c
+++ b/lib/libcrypto/x509v3/pcy_tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcy_tree.c,v 1.10 2014/06/12 15:49:31 deraadt Exp $ */
+/* $OpenBSD: pcy_tree.c,v 1.11 2014/07/09 16:59:33 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2004.
*/
@@ -220,7 +220,7 @@ tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, unsigned int flags)
return 0;
tree->flags = 0;
- tree->levels = reallocarray(NULL, n, sizeof(X509_POLICY_LEVEL));
+ tree->levels = calloc(n, sizeof(X509_POLICY_LEVEL));
tree->nlevel = 0;
tree->extra_data = NULL;
tree->auth_policies = NULL;
@@ -231,8 +231,6 @@ tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, unsigned int flags)
return 0;
}
- memset(tree->levels, 0, n * sizeof(X509_POLICY_LEVEL));
-
tree->nlevel = n;
level = tree->levels;