summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
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 14df2262c..9d43fc3c7 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
@@ -979,6 +979,11 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
979 u_int envsize; 979 u_int envsize;
980 u_int i, namelen; 980 u_int i, namelen;
981 981
982 if (strchr(name, '=') != NULL) {
983 error("Invalid environment variable \"%.100s\"", name);
984 return;
985 }
986
982 /* 987 /*
983 * If we're passed an uninitialized list, allocate a single null 988 * If we're passed an uninitialized list, allocate a single null
984 * entry before continuing. 989 * entry before continuing.
@@ -1898,7 +1903,7 @@ session_unused(int id)
1898 fatal("%s: insane session id %d (max %d nalloc %d)", 1903 fatal("%s: insane session id %d (max %d nalloc %d)",
1899 __func__, id, options.max_sessions, sessions_nalloc); 1904 __func__, id, options.max_sessions, sessions_nalloc);
1900 } 1905 }
1901 bzero(&sessions[id], sizeof(*sessions)); 1906 memset(&sessions[id], 0, sizeof(*sessions));
1902 sessions[id].self = id; 1907 sessions[id].self = id;
1903 sessions[id].used = 0; 1908 sessions[id].used = 0;
1904 sessions[id].chanid = -1; 1909 sessions[id].chanid = -1;
@@ -2234,8 +2239,8 @@ session_env_req(Session *s)
2234 char *name, *val; 2239 char *name, *val;
2235 u_int name_len, val_len, i; 2240 u_int name_len, val_len, i;
2236 2241
2237 name = packet_get_string(&name_len); 2242 name = packet_get_cstring(&name_len);
2238 val = packet_get_string(&val_len); 2243 val = packet_get_cstring(&val_len);
2239 packet_check_eom(); 2244 packet_check_eom();
2240 2245
2241 /* Don't set too many environment variables */ 2246 /* Don't set too many environment variables */