[openssh-commits] [openssh] 02/02: upstream: fix NULL dereference for Match conditions missing

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Mar 18 15:56:49 AEDT 2025


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit b58e429960c4791fc4e30bb7c70d1f77d538b546
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Mar 18 04:53:14 2025 +0000

    upstream: fix NULL dereference for Match conditions missing
    
    arguments, e.g. "Match user". Spotted by Coverity (CID 477813)
    
    OpenBSD-Commit-ID: 13584281cfa23b8ebc41f9d128a6b9464ae960d4
---
 readconf.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/readconf.c b/readconf.c
index c7630f6e..7cbe7d2c 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.397 2025/02/15 01:52:07 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.398 2025/03/18 04:53:14 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -795,8 +795,11 @@ match_cfg_line(Options *options, const char *full_line, int *acp, char ***avp,
 		    strprefix(attrib, "exec=", 1) != NULL) {
 			arg = strchr(attrib, '=');
 			*(arg++) = '\0';
-		} else {
-			arg = argv_next(acp, avp);
+		} else if ((arg = argv_next(acp, avp)) == NULL) {
+			error("%.200s line %d: missing argument for Match '%s'",
+			    filename, linenum, oattrib);
+			result = -1;
+			goto out;
 		}
 
 		/*

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list