diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2023-03-14 08:26:25 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2023-03-14 08:35:31 +0100 |
commit | 1d270bd303afaf6d94e9098cbbf18e5e539e2088 (patch) | |
tree | 80f5a7a7eef623f4eea7fa8eb4fbb0831fd4f1c8 /authfile.c | |
parent | upstream: Limit number of entries in SSH2_MSG_EXT_INFO (diff) | |
download | openssh-1d270bd303afaf6d94e9098cbbf18e5e539e2088.tar.xz openssh-1d270bd303afaf6d94e9098cbbf18e5e539e2088.zip |
upstream: Check pointer for NULL before deref.
None of the existing callers seem to do that, but it's worth checking.
From Coverity CID 291834, ok djm@
OpenBSD-Commit-ID: a0a97113f192a7cb1a2c97b932f677f573cda7a4
Diffstat (limited to 'authfile.c')
-rw-r--r-- | authfile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/authfile.c b/authfile.c index 9ed4f4c3a..445f2dd54 100644 --- a/authfile.c +++ b/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. * @@ -211,6 +211,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; |