From 72e100cd08199371013c462169d24e475c66990c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 3 Jun 2007 21:22:51 +0000 Subject: [PATCH] (hx509_crl_*): fix sizeof() mistakes to fix memory corruption. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20871 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/revoke.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hx509/revoke.c b/lib/hx509/revoke.c index cc21453f5..5a834d447 100644 --- a/lib/hx509/revoke.c +++ b/lib/hx509/revoke.c @@ -1067,7 +1067,7 @@ hx509_crl_alloc(hx509_context context, hx509_crl *crl) { int ret; - *crl = calloc(1, sizeof(*crl)); + *crl = calloc(1, sizeof(**crl)); if (*crl == NULL) { hx509_set_error_string(context, 0, ENOMEM, "out of memory"); return ENOMEM; @@ -1104,7 +1104,7 @@ hx509_crl_free(hx509_context context, hx509_crl *crl) if (*crl == NULL) return; hx509_certs_free(&(*crl)->revoked); - memset(*crl, 0, sizeof(crl)); + memset(*crl, 0, sizeof(**crl)); free(*crl); *crl = NULL; }