diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-10-03 18:03:05 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-10-03 18:03:05 +1000 |
commit | d3d0fa15588c8515751eb5a29f105b30318e9441 (patch) | |
tree | 1f148b48aec1340dd4aff0825278b89648de76b4 | |
parent | d4f04ae2476dded8c3743b0b9152cfe023758236 (diff) |
- markus@cvs.openbsd.org 2005/09/07 08:53:53
[channels.c]
enforce chanid != NULL; ok djm
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | channels.c | 14 |
2 files changed, 14 insertions, 8 deletions
@@ -1,3 +1,9 @@ | |||
1 | 20051003 | ||
2 | - (dtucker) OpenBSD CVS Sync | ||
3 | - markus@cvs.openbsd.org 2005/09/07 08:53:53 | ||
4 | [channels.c] | ||
5 | enforce chanid != NULL; ok djm | ||
6 | |||
1 | 20050930 | 7 | 20050930 |
2 | - (dtucker) [openbsd-compat/openbsd-compat.h] Bug #1096: Add prototype | 8 | - (dtucker) [openbsd-compat/openbsd-compat.h] Bug #1096: Add prototype |
3 | for strtoll. Patch from o.flebbe at science-computing.de. | 9 | for strtoll. Patch from o.flebbe at science-computing.de. |
@@ -3037,4 +3043,4 @@ | |||
3037 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 3043 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
3038 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 3044 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
3039 | 3045 | ||
3040 | $Id: ChangeLog,v 1.3901 2005/09/30 00:23:21 dtucker Exp $ | 3046 | $Id: ChangeLog,v 1.3902 2005/10/03 08:03:05 dtucker Exp $ |
diff --git a/channels.c b/channels.c index 8c7b2b369..af858b4a5 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.223 2005/07/17 07:17:54 djm Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.224 2005/09/07 08:53:53 markus Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -2668,6 +2668,9 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost, | |||
2668 | char strport[NI_MAXSERV]; | 2668 | char strport[NI_MAXSERV]; |
2669 | int gaierr, n, num_socks = 0, socks[NUM_SOCKS]; | 2669 | int gaierr, n, num_socks = 0, socks[NUM_SOCKS]; |
2670 | 2670 | ||
2671 | if (chanids == NULL) | ||
2672 | return -1; | ||
2673 | |||
2671 | for (display_number = x11_display_offset; | 2674 | for (display_number = x11_display_offset; |
2672 | display_number < MAX_DISPLAYS; | 2675 | display_number < MAX_DISPLAYS; |
2673 | display_number++) { | 2676 | display_number++) { |
@@ -2749,8 +2752,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost, | |||
2749 | } | 2752 | } |
2750 | 2753 | ||
2751 | /* Allocate a channel for each socket. */ | 2754 | /* Allocate a channel for each socket. */ |
2752 | if (chanids != NULL) | 2755 | *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1)); |
2753 | *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1)); | ||
2754 | for (n = 0; n < num_socks; n++) { | 2756 | for (n = 0; n < num_socks; n++) { |
2755 | sock = socks[n]; | 2757 | sock = socks[n]; |
2756 | nc = channel_new("x11 listener", | 2758 | nc = channel_new("x11 listener", |
@@ -2758,11 +2760,9 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost, | |||
2758 | CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, | 2760 | CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, |
2759 | 0, "X11 inet listener", 1); | 2761 | 0, "X11 inet listener", 1); |
2760 | nc->single_connection = single_connection; | 2762 | nc->single_connection = single_connection; |
2761 | if (*chanids != NULL) | 2763 | (*chanids)[n] = nc->self; |
2762 | (*chanids)[n] = nc->self; | ||
2763 | } | 2764 | } |
2764 | if (*chanids != NULL) | 2765 | (*chanids)[n] = -1; |
2765 | (*chanids)[n] = -1; | ||
2766 | 2766 | ||
2767 | /* Return the display number for the DISPLAY environment variable. */ | 2767 | /* Return the display number for the DISPLAY environment variable. */ |
2768 | *display_numberp = display_number; | 2768 | *display_numberp = display_number; |