Under low memory conditions (or when testing memory allocation failures),
the key pointer will be 0 - and not initialized. Test and return failure
before deref a NULL.
ticket: 6772
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24292
dc483132-0cff-0310-8789-
dd5450dbe970
krb5_crypto_iov iov;
const struct krb5_enc_provider *enc = &yarrow_enc_provider;
+ /*
+ This can happen if ENOMEM in initializing the key
+ which happens on init or during reseeding
+ */
+ if (!ctx->key)
+ return YARROW_FAIL;
memcpy(out, in, CIPHER_BLOCK_SIZE);
iov.flags = KRB5_CRYPTO_TYPE_DATA;
iov.data = make_data(out, CIPHER_BLOCK_SIZE);