+Thu Mar 21 20:38:38 1996 Richard Basch <basch@lehman.com>
+
+ * decrypt_key.c (krb5_dbekd_decrypt_key_data): bullet-proofing the
+ code -- if the data contents are NULL, do not coredump.
+
Mon Mar 18 21:46:39 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
* configure.in: Add KRB5_RUN_FLAGS
krb5_keyblock * keyblock;
krb5_keysalt * keysalt;
{
- krb5_error_code retval;
+ krb5_error_code retval = 0;
krb5_int16 tmplen;
krb5_octet * ptr;
keyblock->length = 0;
ptr = key_data->key_data_contents[0];
- krb5_kdb_decode_int16(ptr, tmplen);
- ptr += 2;
- keyblock->length = (int) tmplen;
- if ((retval = krb5_decrypt(context, (krb5_pointer) ptr,
- (krb5_pointer)keyblock->contents,
- key_data->key_data_length[0] - 2,
- eblock, 0))) {
- krb5_xfree(keyblock->contents);
- keyblock->contents = 0;
- keyblock->length = 0;
- return retval;
+ if (ptr) {
+ krb5_kdb_decode_int16(ptr, tmplen);
+ ptr += 2;
+ keyblock->length = (int) tmplen;
+ if ((retval = krb5_decrypt(context, (krb5_pointer) ptr,
+ (krb5_pointer)keyblock->contents,
+ key_data->key_data_length[0] - 2,
+ eblock, 0))) {
+ krb5_xfree(keyblock->contents);
+ keyblock->contents = 0;
+ keyblock->length = 0;
+ return retval;
+ }
}
/* Decode salt data */