summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-06-17 22:54:44 +0000
committermillert <millert@openbsd.org>2001-06-17 22:54:44 +0000
commitb413d498e828badb4232738e054ef983f17f929c (patch)
tree224a91f407cf15d146560af09d28d08a817535c3
parentUse BSD authentication to retrieve the challenge so we no longer require (diff)
downloadwireguard-openbsd-b413d498e828badb4232738e054ef983f17f929c.tar.xz
wireguard-openbsd-b413d498e828badb4232738e054ef983f17f929c.zip
be careful to avoid null pointer deref
-rw-r--r--usr.bin/skeyinfo/skeyinfo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/skeyinfo/skeyinfo.c b/usr.bin/skeyinfo/skeyinfo.c
index fbf150aaac6..80050068a69 100644
--- a/usr.bin/skeyinfo/skeyinfo.c
+++ b/usr.bin/skeyinfo/skeyinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: skeyinfo.c,v 1.7 2001/06/17 22:44:51 millert Exp $ */
+/* $OpenBSD: skeyinfo.c,v 1.8 2001/06/17 22:54:44 millert Exp $ */
/*
* Copyright (c) 1997, 2001 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -82,7 +82,8 @@ main(argc, argv)
as = auth_userchallenge(name, "skey", NULL, &challenge);
if (as == NULL || challenge == NULL) {
- auth_close(as);
+ if (as)
+ auth_close(as);
errx(1, "unable to retrieve S/Key challenge for %s", name);
}