summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2023-03-03 09:48:52 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2023-03-03 09:48:52 +0000
commitecfb1db4e16ef8e530d54f6d4b9e35de00ec91c5 (patch)
treec05ce073089d710bbbbc28fbf4c718a0b0c90d70 /usr.bin
parentfbe4fa458417266bf862803570e22bb5c3096b2a (diff)
Check for non-NULL before string comparison. From jjelen at redhat.com
via bz#2687.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/clientloop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index 3e91c7e7814..61b3144221b 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.388 2023/03/03 02:37:58 dtucker Exp $ */
+/* $OpenBSD: clientloop.c,v 1.389 2023/03/03 09:48:51 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2097,7 +2097,7 @@ update_known_hosts(struct hostkeys_update_ctx *ctx)
free(response);
response = read_passphrase("Accept updated hostkeys? "
"(yes/no): ", RP_ECHO);
- if (strcasecmp(response, "yes") == 0)
+ if (response != NULL && strcasecmp(response, "yes") == 0)
break;
else if (quit_pending || response == NULL ||
strcasecmp(response, "no") == 0) {