summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-03-20 00:24:29 +0000
committerColin Watson <cjwatson@debian.org>2014-03-20 00:24:29 +0000
commit796ba4fd011b5d0d9d78d592ba2f30fc9d5ed2e7 (patch)
tree98105bf1621565a2679d5f7f4d650561be2d7666 /session.c
parent9a975a9faed7c4f334e8c8490db3e77e102f2b21 (diff)
parent19158b2447e35838d69b2b735fb640d1e86061ea (diff)
Import openssh_6.6p1.orig.tar.gz
Diffstat (limited to 'session.c')
-rw-r--r--session.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/session.c b/session.c
index 12dd9ab10..2bcf8185c 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.269 2014/01/18 09:36:26 dtucker Exp $ */ 1/* $OpenBSD: session.c,v 1.270 2014/01/31 16:39:19 tedu Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -978,6 +978,11 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
978 u_int envsize; 978 u_int envsize;
979 u_int i, namelen; 979 u_int i, namelen;
980 980
981 if (strchr(name, '=') != NULL) {
982 error("Invalid environment variable \"%.100s\"", name);
983 return;
984 }
985
981 /* 986 /*
982 * If we're passed an uninitialized list, allocate a single null 987 * If we're passed an uninitialized list, allocate a single null
983 * entry before continuing. 988 * entry before continuing.
@@ -1889,7 +1894,7 @@ session_unused(int id)
1889 fatal("%s: insane session id %d (max %d nalloc %d)", 1894 fatal("%s: insane session id %d (max %d nalloc %d)",
1890 __func__, id, options.max_sessions, sessions_nalloc); 1895 __func__, id, options.max_sessions, sessions_nalloc);
1891 } 1896 }
1892 bzero(&sessions[id], sizeof(*sessions)); 1897 memset(&sessions[id], 0, sizeof(*sessions));
1893 sessions[id].self = id; 1898 sessions[id].self = id;
1894 sessions[id].used = 0; 1899 sessions[id].used = 0;
1895 sessions[id].chanid = -1; 1900 sessions[id].chanid = -1;
@@ -2225,8 +2230,8 @@ session_env_req(Session *s)
2225 char *name, *val; 2230 char *name, *val;
2226 u_int name_len, val_len, i; 2231 u_int name_len, val_len, i;
2227 2232
2228 name = packet_get_string(&name_len); 2233 name = packet_get_cstring(&name_len);
2229 val = packet_get_string(&val_len); 2234 val = packet_get_cstring(&val_len);
2230 packet_check_eom(); 2235 packet_check_eom();
2231 2236
2232 /* Don't set too many environment variables */ 2237 /* Don't set too many environment variables */