From: Luke Howard Date: Sat, 11 Aug 2012 04:30:56 +0000 (+1000) Subject: Handle NULL sequence state in exported partial contexts X-Git-Tag: 0.9.2~82 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=commitdiff_plain;h=3e4e9013d9c75c1bd576e95d2733546658dfe822 Handle NULL sequence state in exported partial contexts This could be further improved by not encoding the sequence state if it is zero. --- diff --git a/mech_eap/util_ordering.c b/mech_eap/util_ordering.c index 71ebfb5..bb7e4d5 100644 --- a/mech_eap/util_ordering.c +++ b/mech_eap/util_ordering.c @@ -266,7 +266,10 @@ sequenceExternalize(OM_uint32 *minor, *minor = GSSEAP_WRONG_SIZE; return GSS_S_FAILURE; } - memcpy(*buf, vqueue, sizeof(queue)); + if (vqueue != NULL) + memcpy(*buf, vqueue, sizeof(queue)); + else + memset(*buf, 0, sizeof(queue)); *buf += sizeof(queue); *lenremain -= sizeof(queue);