summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-11-28 04:27:59 +0100
committerDarren Tucker <dtucker@dtucker.net>2020-11-28 13:59:42 +0100
commit022def7bd16c3426a95e25f57cb259d54468341c (patch)
treebc47ae95fd5a95925dc01952b44c542d6e8ab85e /session.c
parentupstream: Document ssh-keygen -Z, sanity check its argument earlier and (diff)
downloadopenssh-022def7bd16c3426a95e25f57cb259d54468341c.tar.xz
openssh-022def7bd16c3426a95e25f57cb259d54468341c.zip
upstream: check result of strchr() against NULL rather than
searched-for characters; from zhongjubin@huawei.com OpenBSD-Commit-ID: e6f57de1d4a4d25f8db2d44e8d58d847e247a4fe
Diffstat (limited to '')
-rw-r--r--session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/session.c b/session.c
index b25cbca69..2f716ce97 100644
--- 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 ||