]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: check result of strchr() against NULL rather than
authordjm@openbsd.org <djm@openbsd.org>
Sat, 28 Nov 2020 03:27:59 +0000 (03:27 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Sat, 28 Nov 2020 12:59:42 +0000 (23:59 +1100)
searched-for characters; from zhongjubin@huawei.com

OpenBSD-Commit-ID: e6f57de1d4a4d25f8db2d44e8d58d847e247a4fe

session.c

index b25cbca69d122f427a8c9bf99ea8a535cc1d298a..2f716ce97bde93681b157a03f2b04d0f6f5ec44b 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.325 2020/10/18 11:32:02 djm Exp $ */
+/* $OpenBSD: session.c,v 1.326 2020/11/28 03:27:59 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -1105,7 +1105,7 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
                for (n = 0 ; n < auth_opts->nenv; n++) {
                        ocp = xstrdup(auth_opts->env[n]);
                        cp = strchr(ocp, '=');
-                       if (*cp == '=') {
+                       if (cp != NULL) {
                                *cp = '\0';
                                /* Apply PermitUserEnvironment allowlist */
                                if (options.permit_user_env_allowlist == NULL ||