summaryrefslogtreecommitdiffstats
path: root/libexec/login_token
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-03-10 21:30:27 +0000
committermillert <millert@openbsd.org>2004-03-10 21:30:27 +0000
commit89c6b15d291f6717fdbbdf27b10eb5752e75fe08 (patch)
tree2fef699c9c37f516b999a8cc33284e56a5fc30e1 /libexec/login_token
parentCheck getpass() return value for NULL. Closes Pr 3706. (diff)
downloadwireguard-openbsd-89c6b15d291f6717fdbbdf27b10eb5752e75fe08.tar.xz
wireguard-openbsd-89c6b15d291f6717fdbbdf27b10eb5752e75fe08.zip
More checking for a NULL return value from getpass(). otto@ OK
Diffstat (limited to 'libexec/login_token')
-rw-r--r--libexec/login_token/login_token.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/login_token/login_token.c b/libexec/login_token/login_token.c
index 29e091e2f19..668a3b0fc02 100644
--- a/libexec/login_token/login_token.c
+++ b/libexec/login_token/login_token.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_token.c,v 1.7 2002/09/06 18:19:14 deraadt Exp $ */
+/* $OpenBSD: login_token.c,v 1.8 2004/03/10 21:30:27 millert Exp $ */
/*-
* Copyright (c) 1995, 1996 Berkeley Software Design, Inc. All rights reserved.
@@ -156,12 +156,16 @@ main(int argc, char *argv[])
}
pp = readpassphrase(challenge, response, sizeof(response), 0);
- if (!pp || *pp == '\0') {
+ if (pp == NULL)
+ exit(1);
+ if (*pp == '\0') {
char buf[64];
snprintf(buf, sizeof(buf), "%s Response [echo on]: ",
tt->proper);
pp = readpassphrase(buf, response, sizeof(response),
RPP_ECHO_ON);
+ if (pp == NULL)
+ exit(1);
}
}