summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/channels.c b/channels.c
index 226ba7a39..95a51e21b 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.395 2020/01/25 06:40:20 djm Exp $ */ 1/* $OpenBSD: channels.c,v 1.398 2020/04/25 06:59:36 dtucker 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
@@ -454,7 +454,7 @@ fwd_perm_clear(struct permission *perm)
454 free(perm->host_to_connect); 454 free(perm->host_to_connect);
455 free(perm->listen_host); 455 free(perm->listen_host);
456 free(perm->listen_path); 456 free(perm->listen_path);
457 bzero(perm, sizeof(*perm)); 457 memset(perm, 0, sizeof(*perm));
458} 458}
459 459
460/* Returns an printable name for the specified forwarding permission list */ 460/* Returns an printable name for the specified forwarding permission list */
@@ -625,14 +625,12 @@ channel_free(struct ssh *ssh, Channel *c)
625 if (cc->abandon_cb != NULL) 625 if (cc->abandon_cb != NULL)
626 cc->abandon_cb(ssh, c, cc->ctx); 626 cc->abandon_cb(ssh, c, cc->ctx);
627 TAILQ_REMOVE(&c->status_confirms, cc, entry); 627 TAILQ_REMOVE(&c->status_confirms, cc, entry);
628 explicit_bzero(cc, sizeof(*cc)); 628 freezero(cc, sizeof(*cc));
629 free(cc);
630 } 629 }
631 if (c->filter_cleanup != NULL && c->filter_ctx != NULL) 630 if (c->filter_cleanup != NULL && c->filter_ctx != NULL)
632 c->filter_cleanup(ssh, c->self, c->filter_ctx); 631 c->filter_cleanup(ssh, c->self, c->filter_ctx);
633 sc->channels[c->self] = NULL; 632 sc->channels[c->self] = NULL;
634 explicit_bzero(c, sizeof(*c)); 633 freezero(c, sizeof(*c));
635 free(c);
636} 634}
637 635
638void 636void
@@ -3295,8 +3293,7 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
3295 return 0; 3293 return 0;
3296 cc->cb(ssh, type, c, cc->ctx); 3294 cc->cb(ssh, type, c, cc->ctx);
3297 TAILQ_REMOVE(&c->status_confirms, cc, entry); 3295 TAILQ_REMOVE(&c->status_confirms, cc, entry);
3298 explicit_bzero(cc, sizeof(*cc)); 3296 freezero(cc, sizeof(*cc));
3299 free(cc);
3300 return 0; 3297 return 0;
3301} 3298}
3302 3299
@@ -4004,7 +4001,7 @@ channel_request_rforward_cancel_tcpip(struct ssh *ssh,
4004 struct permission_set *pset = &sc->local_perms; 4001 struct permission_set *pset = &sc->local_perms;
4005 int r; 4002 int r;
4006 u_int i; 4003 u_int i;
4007 struct permission *perm; 4004 struct permission *perm = NULL;
4008 4005
4009 for (i = 0; i < pset->num_permitted_user; i++) { 4006 for (i = 0; i < pset->num_permitted_user; i++) {
4010 perm = &pset->permitted_user[i]; 4007 perm = &pset->permitted_user[i];
@@ -4040,7 +4037,7 @@ channel_request_rforward_cancel_streamlocal(struct ssh *ssh, const char *path)
4040 struct permission_set *pset = &sc->local_perms; 4037 struct permission_set *pset = &sc->local_perms;
4041 int r; 4038 int r;
4042 u_int i; 4039 u_int i;
4043 struct permission *perm; 4040 struct permission *perm = NULL;
4044 4041
4045 for (i = 0; i < pset->num_permitted_user; i++) { 4042 for (i = 0; i < pset->num_permitted_user; i++) {
4046 perm = &pset->permitted_user[i]; 4043 perm = &pset->permitted_user[i];