=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/session.c,v retrieving revision 1.270 retrieving revision 1.271 diff -u -r1.270 -r1.271 --- src/usr.bin/ssh/session.c 2014/01/31 16:39:19 1.270 +++ src/usr.bin/ssh/session.c 2014/03/03 22:22:30 1.271 @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.270 2014/01/31 16:39:19 tedu Exp $ */ +/* $OpenBSD: session.c,v 1.271 2014/03/03 22:22:30 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -871,6 +871,11 @@ u_int envsize; u_int i, namelen; + if (strchr(name, '=') != NULL) { + error("Invalid environment variable \"%.100s\"", name); + return; + } + /* * Find the slot where the value should be stored. If the variable * already exists, we reuse the slot; otherwise we append a new slot @@ -1858,8 +1863,8 @@ char *name, *val; u_int name_len, val_len, i; - name = packet_get_string(&name_len); - val = packet_get_string(&val_len); + name = packet_get_cstring(&name_len); + val = packet_get_cstring(&val_len); packet_check_eom(); /* Don't set too many environment variables */