summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2006-03-20 11:38:46 +0000
committerdjm <djm@openbsd.org>2006-03-20 11:38:46 +0000
commit0daee070250353a4626391ab8ec22d3451615374 (patch)
tree9be5d453c553fcf899b80823176ef6a4fdefd0dd /usr.bin/ssh/key.c
parentreport function m4errx, that shows app-specific data (filename/linenumber) (diff)
downloadwireguard-openbsd-0daee070250353a4626391ab8ec22d3451615374.tar.xz
wireguard-openbsd-0daee070250353a4626391ab8ec22d3451615374.zip
(really) last of the Coverity diffs: avoid possible NULL deref in
key_free. via elad AT netbsd.org; markus@ ok
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index 5cb54c13b71..283aea99ebd 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/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: