From 429fcc23db22469ca48d18ad4a2940a265965caf Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 26 Mar 2006 14:02:16 +1100 Subject: [PATCH] - djm@cvs.openbsd.org 2006/03/20 11:38:46 [key.c] (really) last of the Coverity diffs: avoid possible NULL deref in key_free. via elad AT netbsd.org; markus@ ok --- ChangeLog | 6 +++++- key.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8bebeda19..4928e20b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,10 @@ memory leaks detected by Coverity via elad AT netbsd.org; deraadt@ ok that should be all of them now + - djm@cvs.openbsd.org 2006/03/20 11:38:46 + [key.c] + (really) last of the Coverity diffs: avoid possible NULL deref in + key_free. via elad AT netbsd.org; markus@ ok 20060325 - OpenBSD CVS Sync @@ -4318,4 +4322,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4258 2006/03/26 03:01:54 djm Exp $ +$Id: ChangeLog,v 1.4259 2006/03/26 03:02:16 djm Exp $ diff --git a/key.c b/key.c index 5cb54c13b..283aea99e 100644 --- a/key.c +++ b/key.c @@ -122,6 +122,8 @@ key_new_private(int type) void key_free(Key *k) { + if (k == NULL) + fatal("key_free: key is NULL); switch (k->type) { case KEY_RSA1: case KEY_RSA: