]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: match_user() shouldn't be called with user==NULL unless
authordjm@openbsd.org <djm@openbsd.org>
Thu, 6 Apr 2023 03:19:32 +0000 (03:19 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 6 Apr 2023 03:27:16 +0000 (13:27 +1000)
host and ipaddr are also NULL

OpenBSD-Commit-ID: fa3518346c21483e9e01a2e4b9436ae501daf8ea

match.c

diff --git a/match.c b/match.c
index 3ac854d38f0042867be47868469edb795e7ff836..d6af2561ffd3ac417beb2211bc5983db2c0b8a1a 100644 (file)
--- a/match.c
+++ b/match.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: match.c,v 1.43 2020/11/03 22:53:12 djm Exp $ */
+/* $OpenBSD: match.c,v 1.44 2023/04/06 03:19:32 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -247,6 +247,9 @@ match_user(const char *user, const char *host, const char *ipaddr,
                return 0;
        }
 
+       if (user == NULL)
+               return 0; /* shouldn't happen */
+
        if ((p = strchr(pattern, '@')) == NULL)
                return match_pattern(user, pattern);