mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Clear the environment properly by looping until it is empty rather than
looping over it (which may skip entries), from Brad King.
This commit is contained in:
parent
68d797587e
commit
d551ab8e5c
@ -196,10 +196,10 @@ void
|
|||||||
environ_push(struct environ *env)
|
environ_push(struct environ *env)
|
||||||
{
|
{
|
||||||
struct environ_entry *envent;
|
struct environ_entry *envent;
|
||||||
char **vp, *v;
|
char *v;
|
||||||
|
|
||||||
for (vp = environ; *vp != NULL; vp++) {
|
while (*environ != NULL) {
|
||||||
v = xstrdup(*vp);
|
v = xstrdup(*environ);
|
||||||
v[strcspn(v, "=")] = '\0';
|
v[strcspn(v, "=")] = '\0';
|
||||||
|
|
||||||
unsetenv(v);
|
unsetenv(v);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user