From 88259fbbc59253224aa5d0124eeab0b34140d985 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 12 Jun 2001 00:21:34 +0000 Subject: - markus@cvs.openbsd.org 2001/06/11 10:18:24 [session.c] reset pointer to NULL after xfree(); report from solar@openwall.com --- ChangeLog | 5 ++++- session.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72ad70a8c..2ddcce027 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ [dispatch.c] we support rekeying protocol errors are fatal. + - markus@cvs.openbsd.org 2001/06/11 10:18:24 + [session.c] + reset pointer to NULL after xfree(); report from solar@openwall.com 20010611 - (bal) NeXT/MacOS X lack libgen.h and dirname(). Patch by Mark Miller @@ -5610,4 +5613,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1278 2001/06/12 00:15:57 mouring Exp $ +$Id: ChangeLog,v 1.1279 2001/06/12 00:21:34 mouring Exp $ diff --git a/session.c b/session.c index 9f472a22b..4dfca3575 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.83 2001/06/07 22:25:02 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.84 2001/06/11 10:18:24 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -364,6 +364,8 @@ do_authenticated1(Authctxt *authctxt) if (!success) { xfree(s->auth_proto); xfree(s->auth_data); + s->auth_proto = NULL; + s->auth_data = NULL; } break; @@ -1047,7 +1049,7 @@ do_child(Session *s, const char *command) extern char **environ; struct stat st; char *argv[10]; - int do_xauth = s->auth_proto != NULL && s->auth_data != NULL; + int do_xauth; #ifdef WITH_IRIX_PROJECT prid_t projid; #endif /* WITH_IRIX_PROJECT */ @@ -1059,6 +1061,9 @@ do_child(Session *s, const char *command) #endif /* WITH_IRIX_ARRAY */ #endif /* WITH_IRIX_JOBS */ + do_xauth = + s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; + /* remove hostkey from the child's memory */ destroy_sensitive_data(); @@ -1731,6 +1736,8 @@ session_x11_req(Session *s) if (!success) { xfree(s->auth_proto); xfree(s->auth_data); + s->auth_proto = NULL; + s->auth_data = NULL; } return success; } -- cgit v1.2.3