summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2023-03-14 07:26:26 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2023-03-14 07:26:26 +0000
commit03e169f18a4e6cd4bdacc71450af566bb9cab278 (patch)
tree2e2d904570bcea7985526399974562ac42255c80 /usr.bin
parente0d83516e34193e901820d0d8ded95e05ad5782f (diff)
Check pointer for NULL before attempting to deref. None of the existing
callers seem to do that, but it's worth checking. From Coverity CID 291834, ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/authfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c
index 418e405bfc5..eb0bdeda2a0 100644
--- a/usr.bin/ssh/authfile.c
+++ b/usr.bin/ssh/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.143 2022/06/21 14:52:13 tobhe Exp $ */
+/* $OpenBSD: authfile.c,v 1.144 2023/03/14 07:26:25 dtucker Exp $ */
/*
* Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
*
@@ -206,6 +206,8 @@ sshkey_try_load_public(struct sshkey **kp, const char *filename,
int r;
struct sshkey *k = NULL;
+ if (kp == NULL)
+ return SSH_ERR_INVALID_ARGUMENT;
*kp = NULL;
if (commentp != NULL)
*commentp = NULL;