summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/channels.c b/channels.c
index 9486c1cff..f72b8cc62 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.341 2015/02/06 23:21:59 millert Exp $ */ 1/* $OpenBSD: channels.c,v 1.342 2015/04/24 01:36:00 deraadt Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -306,7 +306,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
306 if (channels_alloc > 10000) 306 if (channels_alloc > 10000)
307 fatal("channel_new: internal error: channels_alloc %d " 307 fatal("channel_new: internal error: channels_alloc %d "
308 "too big.", channels_alloc); 308 "too big.", channels_alloc);
309 channels = xrealloc(channels, channels_alloc + 10, 309 channels = xreallocarray(channels, channels_alloc + 10,
310 sizeof(Channel *)); 310 sizeof(Channel *));
311 channels_alloc += 10; 311 channels_alloc += 10;
312 debug2("channel: expanding %d", channels_alloc); 312 debug2("channel: expanding %d", channels_alloc);
@@ -2192,8 +2192,8 @@ channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
2192 2192
2193 /* perhaps check sz < nalloc/2 and shrink? */ 2193 /* perhaps check sz < nalloc/2 and shrink? */
2194 if (*readsetp == NULL || sz > *nallocp) { 2194 if (*readsetp == NULL || sz > *nallocp) {
2195 *readsetp = xrealloc(*readsetp, nfdset, sizeof(fd_mask)); 2195 *readsetp = xreallocarray(*readsetp, nfdset, sizeof(fd_mask));
2196 *writesetp = xrealloc(*writesetp, nfdset, sizeof(fd_mask)); 2196 *writesetp = xreallocarray(*writesetp, nfdset, sizeof(fd_mask));
2197 *nallocp = sz; 2197 *nallocp = sz;
2198 } 2198 }
2199 *maxfdp = n; 2199 *maxfdp = n;
@@ -3237,7 +3237,7 @@ channel_request_remote_forwarding(struct Forward *fwd)
3237 } 3237 }
3238 if (success) { 3238 if (success) {
3239 /* Record that connection to this host/port is permitted. */ 3239 /* Record that connection to this host/port is permitted. */
3240 permitted_opens = xrealloc(permitted_opens, 3240 permitted_opens = xreallocarray(permitted_opens,
3241 num_permitted_opens + 1, sizeof(*permitted_opens)); 3241 num_permitted_opens + 1, sizeof(*permitted_opens));
3242 idx = num_permitted_opens++; 3242 idx = num_permitted_opens++;
3243 if (fwd->connect_path != NULL) { 3243 if (fwd->connect_path != NULL) {
@@ -3468,7 +3468,7 @@ channel_add_permitted_opens(char *host, int port)
3468{ 3468{
3469 debug("allow port forwarding to host %s port %d", host, port); 3469 debug("allow port forwarding to host %s port %d", host, port);
3470 3470
3471 permitted_opens = xrealloc(permitted_opens, 3471 permitted_opens = xreallocarray(permitted_opens,
3472 num_permitted_opens + 1, sizeof(*permitted_opens)); 3472 num_permitted_opens + 1, sizeof(*permitted_opens));
3473 permitted_opens[num_permitted_opens].host_to_connect = xstrdup(host); 3473 permitted_opens[num_permitted_opens].host_to_connect = xstrdup(host);
3474 permitted_opens[num_permitted_opens].port_to_connect = port; 3474 permitted_opens[num_permitted_opens].port_to_connect = port;
@@ -3518,7 +3518,7 @@ channel_add_adm_permitted_opens(char *host, int port)
3518{ 3518{
3519 debug("config allows port forwarding to host %s port %d", host, port); 3519 debug("config allows port forwarding to host %s port %d", host, port);
3520 3520
3521 permitted_adm_opens = xrealloc(permitted_adm_opens, 3521 permitted_adm_opens = xreallocarray(permitted_adm_opens,
3522 num_adm_permitted_opens + 1, sizeof(*permitted_adm_opens)); 3522 num_adm_permitted_opens + 1, sizeof(*permitted_adm_opens));
3523 permitted_adm_opens[num_adm_permitted_opens].host_to_connect 3523 permitted_adm_opens[num_adm_permitted_opens].host_to_connect
3524 = xstrdup(host); 3524 = xstrdup(host);