summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/yarrow
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2009-06-11 17:01:13 +0000
committerEzra Peisach <epeisach@mit.edu>2009-06-11 17:01:13 +0000
commit2ba32d69322ac7d2b1b8c7b02d996f2ec02d9e59 (patch)
tree2a33dd56e019dd0b2cacbd27a3437fdff40d8aae /src/lib/crypto/yarrow
parentccdee10e6b9c218f3e82e5987d716bfb7cbb1c90 (diff)
downloadkrb5-2ba32d69322ac7d2b1b8c7b02d996f2ec02d9e59.tar.gz
krb5-2ba32d69322ac7d2b1b8c7b02d996f2ec02d9e59.tar.xz
krb5-2ba32d69322ac7d2b1b8c7b02d996f2ec02d9e59.zip
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
Diffstat (limited to 'src/lib/crypto/yarrow')
-rw-r--r--src/lib/crypto/yarrow/yarrow.c3
1 files changed, 2 insertions, 1 deletions
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;
}