Skip to content

Commit b58e429

Browse files
committed
upstream: fix NULL dereference for Match conditions missing
arguments, e.g. "Match user". Spotted by Coverity (CID 477813) OpenBSD-Commit-ID: 13584281cfa23b8ebc41f9d128a6b9464ae960d4
1 parent 0ce5281 commit b58e429

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

readconf.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: readconf.c,v 1.397 2025/02/15 01:52:07 djm Exp $ */
1+
/* $OpenBSD: readconf.c,v 1.398 2025/03/18 04:53:14 djm Exp $ */
22
/*
33
* Author: Tatu Ylonen <[email protected]>
44
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
@@ -795,8 +795,11 @@ match_cfg_line(Options *options, const char *full_line, int *acp, char ***avp,
795795
strprefix(attrib, "exec=", 1) != NULL) {
796796
arg = strchr(attrib, '=');
797797
*(arg++) = '\0';
798-
} else {
799-
arg = argv_next(acp, avp);
798+
} else if ((arg = argv_next(acp, avp)) == NULL) {
799+
error("%.200s line %d: missing argument for Match '%s'",
800+
filename, linenum, oattrib);
801+
result = -1;
802+
goto out;
800803
}
801804

802805
/*

0 commit comments

Comments
 (0)