summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-10-03 18:03:33 +1000
committerDarren Tucker <dtucker@zip.com.au>2005-10-03 18:03:33 +1000
commit303fa18d3e890afafdd26774efbf021df905eca0 (patch)
tree6ee5b6edf7e20ccc4f2014aa84251db9c874120c
parent8c4d25fd31f270c0a3f073a460d6516b7c471f71 (diff)
- markus@cvs.openbsd.org 2005/09/07 08:53:53
[channels.c] enforce chanid != NULL; ok djm
-rw-r--r--ChangeLog8
-rw-r--r--channels.c14
2 files changed, 14 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 554f17e2..01001264 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+20051003
+ - (dtucker) OpenBSD CVS Sync
+ - markus@cvs.openbsd.org 2005/09/07 08:53:53
+ [channels.c]
+ enforce chanid != NULL; ok djm
+
20050930
- (dtucker) [openbsd-compat/openbsd-compat.h] Bug #1096: Add prototype
for strtoll. Patch from o.flebbe at science-computing.de.
@@ -3003,4 +3009,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3887.2.4 2005/09/30 00:55:17 dtucker Exp $
+$Id: ChangeLog,v 1.3887.2.5 2005/10/03 08:03:33 dtucker Exp $
diff --git a/channels.c b/channels.c
index 8c7b2b36..af858b4a 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.223 2005/07/17 07:17:54 djm Exp $");
+RCSID("$OpenBSD: channels.c,v 1.224 2005/09/07 08:53:53 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -2668,6 +2668,9 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
char strport[NI_MAXSERV];
int gaierr, n, num_socks = 0, socks[NUM_SOCKS];
+ if (chanids == NULL)
+ return -1;
+
for (display_number = x11_display_offset;
display_number < MAX_DISPLAYS;
display_number++) {
@@ -2749,8 +2752,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
}
/* Allocate a channel for each socket. */
- if (chanids != NULL)
- *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1));
+ *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1));
for (n = 0; n < num_socks; n++) {
sock = socks[n];
nc = channel_new("x11 listener",
@@ -2758,11 +2760,9 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
0, "X11 inet listener", 1);
nc->single_connection = single_connection;
- if (*chanids != NULL)
- (*chanids)[n] = nc->self;
+ (*chanids)[n] = nc->self;
}
- if (*chanids != NULL)
- (*chanids)[n] = -1;
+ (*chanids)[n] = -1;
/* Return the display number for the DISPLAY environment variable. */
*display_numberp = display_number;