summaryrefslogtreecommitdiff
path: root/lib/gnutls_x509.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2006-02-01 15:47:57 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2006-02-01 15:47:57 +0000
commit181a82008ad58fcdc9ec20092a5a29f91b9a8ecb (patch)
tree79137f70f3aa1afd75ee51618e045b554b655e32 /lib/gnutls_x509.c
parent7e3aa4ef04a1f037799fd7cbe0b47f514aeca1b6 (diff)
downloadgnutls-181a82008ad58fcdc9ec20092a5a29f91b9a8ecb.tar.gz
Corrected bugs in gnutls_certificate_set_x509_crl() and gnutls_certificate_set_x509_trust(), that caused memory corruption if more than one certificates were added. Report and patch by Max Kellermann <max@duempel.org>.
Diffstat (limited to 'lib/gnutls_x509.c')
-rw-r--r--lib/gnutls_x509.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index d52e89a7fa..ad6acd617b 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
*
* Author: Nikos Mavroyanopoulos
*
@@ -1433,19 +1433,19 @@ gnutls_certificate_set_x509_trust (gnutls_certificate_credentials_t res,
for (i = 0; i < ca_list_size; i++)
{
- ret = gnutls_x509_crt_init (&res->x509_ca_list[i + res->x509_ncas]);
+ ret = gnutls_x509_crt_init (&res->x509_ca_list[ res->x509_ncas]);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
- ret = _gnutls_x509_crt_cpy (res->x509_ca_list[i + res->x509_ncas],
+ ret = _gnutls_x509_crt_cpy (res->x509_ca_list[ res->x509_ncas],
ca_list[i]);
if (ret < 0)
{
gnutls_assert ();
- gnutls_x509_crt_deinit (res->x509_ca_list[i + res->x509_ncas]);
+ gnutls_x509_crt_deinit (res->x509_ca_list[ res->x509_ncas]);
return ret;
}
res->x509_ncas++;
@@ -1743,7 +1743,7 @@ gnutls_certificate_set_x509_crl (gnutls_certificate_credentials_t res,
for (i = 0; i < crl_list_size; i++)
{
- ret = _gnutls_x509_crl_cpy (res->x509_crl_list[i + res->x509_ncrls],
+ ret = _gnutls_x509_crl_cpy (res->x509_crl_list[ res->x509_ncrls],
crl_list[i]);
if (ret < 0)
{