+Fri Nov 6 09:19:23 1998 Ezra Peisach <epeisach@mit.edu>
+
+ * k5unseal.c (kg2_unwrap_integ): Handle case of malloc(0)
+ returning NULL.
+
1998-10-27 Marc Horowitz <marc@mit.edu>
* Makefile.in, accept_sec_context.c, acquire_cred.c, canon_name.c,
return(retval);
}
- if ((output->value = (void *) malloc(tmsglen)) == NULL) {
- *minor_status = ENOMEM;
- return(GSS_S_FAILURE);
+ if (tmsglen) {
+ if ((output->value = (void *) malloc(tmsglen)) == NULL) {
+ *minor_status = ENOMEM;
+ return(GSS_S_FAILURE);
+ }
+ memcpy(output->value, tmsg, tmsglen);
+ output->length = tmsglen;
}
- memcpy(output->value, tmsg, tmsglen);
- output->length = tmsglen;
-
if (qop_state)
*qop_state = GSS_C_QOP_DEFAULT;
tmsg = ptr;
- if ((output->value = (void *) malloc(tmsglen)) == NULL) {
- free(plain.data);
- *minor_status = ENOMEM;
- return(GSS_S_FAILURE);
+ if (tmsglen) {
+ if ((output->value = (void *) malloc(tmsglen)) == NULL) {
+ free(plain.data);
+ *minor_status = ENOMEM;
+ return(GSS_S_FAILURE);
+ }
+ memcpy(output->value, tmsg, tmsglen);
+ output->length = tmsglen;
}
- memcpy(output->value, tmsg, tmsglen);
- output->length = tmsglen;
-
if (qop_state)
*qop_state = GSS_C_QOP_DEFAULT;