From 36460f0afcaf8d9c56200541ef9c3cca38e87b98 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 11 Feb 2012 23:24:52 +0000 Subject: [PATCH] Correct a fencepost in ASN.1 encode_cntype For cntype_choice, count must be less than choice->n_options. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25684 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/asn1_encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index 48ecc2ff6..7385cfa63 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -500,7 +500,7 @@ encode_cntype(asn1buf *buf, const void *val, unsigned int count, } case cntype_choice: { const struct choice_info *choice = c->tinfo; - if (count > choice->n_options) + if (count >= choice->n_options) return ASN1_MISSING_FIELD; return krb5int_asn1_encode_type(buf, val, choice->options[count], rettag); -- 2.26.2