svn rev #24292: trunk/src/lib/crypto/krb/yarrow/
epeisach@MIT.EDU
epeisach at MIT.EDU
Sat Sep 4 17:46:53 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=24292
Commit By: epeisach
Log Message:
ticket: 6772
subject: Ensure valid key in krb5int_yarrow_cipher_encrypt_block
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.
Changed Files:
U trunk/src/lib/crypto/krb/yarrow/ycipher.c
Modified: trunk/src/lib/crypto/krb/yarrow/ycipher.c
===================================================================
--- trunk/src/lib/crypto/krb/yarrow/ycipher.c 2010-09-04 21:43:04 UTC (rev 24291)
+++ trunk/src/lib/crypto/krb/yarrow/ycipher.c 2010-09-04 21:46:53 UTC (rev 24292)
@@ -74,6 +74,12 @@
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);
More information about the cvs-krb5
mailing list