From b7bae0b201fc0dee8cc2297f297b8cda2d23c74f Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 20 Sep 2009 21:57:20 -0700 Subject: [PATCH] make sure there are splace for storing ETYPE_NULL att the end of the array --- lib/krb5/init_creds_pw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/krb5/init_creds_pw.c b/lib/krb5/init_creds_pw.c index 0c2f5cf53..5363d533e 100644 --- a/lib/krb5/init_creds_pw.c +++ b/lib/krb5/init_creds_pw.c @@ -1473,13 +1473,13 @@ krb5_init_creds_set_keytab(krb5_context context, goto next; /* add enctype to supported list */ - ptr = realloc(etypes, sizeof(etypes[0]) * (netypes + 1)); + ptr = realloc(etypes, sizeof(etypes[0]) * (netypes + 2)); if (ptr == NULL) goto next; etypes = ptr; etypes[netypes] = entry.keyblock.keytype; - etypes[netypes + 1] = 0; + etypes[netypes + 1] = ETYPE_NULL; netypes++; next: krb5_kt_free_entry(context, &entry);