summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-08-29 10:40:20 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-08-29 10:40:20 +0000
commit7a1362a6a8aa6259d41005c8d5a5e3fb52b9ac86 (patch)
tree79de67a71cb96288865ed61845c82faa0930693b /usr.bin
parentd46ff131dd7777c6e987473fa25efe129356e12c (diff)
normalise some inconsistent (but harmless) NULL pointer checks
spotted by the Stanford SATURN tool, via Isil Dillig; ok markus@ deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/channels.c6
-rw-r--r--usr.bin/ssh/session.c13
2 files changed, 9 insertions, 10 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 95d652369da..eb7752d9645 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.265 2006/08/03 03:34:41 deraadt Exp $ */
+/* $OpenBSD: channels.c,v 1.266 2006/08/29 10:40:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3120,9 +3120,7 @@ x11_request_forwarding_with_spoofing(int client_session_id, const char *disp,
return;
}
- cp = disp;
- if (disp)
- cp = strchr(disp, ':');
+ cp = strchr(disp, ':');
if (cp)
cp = strchr(cp, '.');
if (cp)
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 9183c951d8e..43218690afe 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.218 2006/08/18 09:15:20 markus Exp $ */
+/* $OpenBSD: session.c,v 1.219 2006/08/29 10:40:19 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1823,12 +1823,13 @@ session_close(Session *s)
if (s->auth_proto)
xfree(s->auth_proto);
s->used = 0;
- for (i = 0; i < s->num_env; i++) {
- xfree(s->env[i].name);
- xfree(s->env[i].val);
- }
- if (s->env != NULL)
+ if (s->env != NULL) {
+ for (i = 0; i < s->num_env; i++) {
+ xfree(s->env[i].name);
+ xfree(s->env[i].val);
+ }
xfree(s->env);
+ }
session_proctitle(s);
}