From 2ba32d69322ac7d2b1b8c7b02d996f2ec02d9e59 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 11 Jun 2009 17:01:13 +0000 Subject: [PATCH] krb5int_yarrow_final could deref NULL if out of memory krb5int_yarrow_final tests if the Yarrow_CTX* is valid (not NULL) - and if not - signals and error for return - but still invokes mem_zero (memset) with it as an argument. This will only happen in an out-of-memory situation. ticket: 6512 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22410 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/yarrow/yarrow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/yarrow/yarrow.c b/src/lib/crypto/yarrow/yarrow.c index b52057daa..9e3c91588 100644 --- a/src/lib/crypto/yarrow/yarrow.c +++ b/src/lib/crypto/yarrow/yarrow.c @@ -918,7 +918,8 @@ int krb5int_yarrow_final(Yarrow_CTX* y) CATCH: krb5int_yarrow_cipher_final(&y->cipher); - mem_zero( y, sizeof(Yarrow_CTX) ); + if ( y ) + mem_zero( y, sizeof(Yarrow_CTX) ); if ( locked ) { TRY( UNLOCK() ); } EXCEP_RET; } -- 2.26.2