diff --git a/lib/gssapi/krb5/sequence.c b/lib/gssapi/krb5/sequence.c index 3b0d862c4..d9a5f9c01 100644 --- a/lib/gssapi/krb5/sequence.c +++ b/lib/gssapi/krb5/sequence.c @@ -105,7 +105,7 @@ elem_insert(struct gss_msg_order *o, if (o->length > after_slot) memmove(&o->elem[after_slot + 1], &o->elem[after_slot], - (o->length - after_slot) * sizeof(o->elem[0])); + (o->length - after_slot - 1) * sizeof(o->elem[0])); elem_set(o, after_slot, seq_num); diff --git a/lib/gssapi/sequence.c b/lib/gssapi/sequence.c index 3b0d862c4..d9a5f9c01 100644 --- a/lib/gssapi/sequence.c +++ b/lib/gssapi/sequence.c @@ -105,7 +105,7 @@ elem_insert(struct gss_msg_order *o, if (o->length > after_slot) memmove(&o->elem[after_slot + 1], &o->elem[after_slot], - (o->length - after_slot) * sizeof(o->elem[0])); + (o->length - after_slot - 1) * sizeof(o->elem[0])); elem_set(o, after_slot, seq_num);