summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-06-26 09:36:34 +1000
committerDamien Miller <djm@mindrot.org>2010-06-26 09:36:34 +1000
commitc094d1e4812e6560f2e9c9790a5866ee3a4654ec (patch)
treea307f2ab1490da54d0510b510ecc1601dca69c88
parent4fe686d35fc1bbf5f160d1619ab392e09f3bd5c5 (diff)
- djm@cvs.openbsd.org 2010/06/17 07:07:30
[mux.c] Correct sizing of object to be allocated by calloc(), replacing sizeof(state) with sizeof(*state). This worked by accident since the struct contained a single int at present, but could have broken in the future. patch from hyc AT symas.com
-rw-r--r--ChangeLog6
-rw-r--r--mux.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d990febb..b052a202c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,12 @@
7 [ssh-pkcs11.c] 7 [ssh-pkcs11.c]
8 check length of value returned C_GetAttributValue for != 0 8 check length of value returned C_GetAttributValue for != 0
9 from mdrtbugzilla@codefive.co.uk; bugzilla #1773; ok dtucker@ 9 from mdrtbugzilla@codefive.co.uk; bugzilla #1773; ok dtucker@
10 - djm@cvs.openbsd.org 2010/06/17 07:07:30
11 [mux.c]
12 Correct sizing of object to be allocated by calloc(), replacing
13 sizeof(state) with sizeof(*state). This worked by accident since
14 the struct contained a single int at present, but could have broken
15 in the future. patch from hyc AT symas.com
10 16
1120100622 1720100622
12 - (djm) [loginrec.c] crank LINFO_NAMESIZE (username length) to 512 18 - (djm) [loginrec.c] crank LINFO_NAMESIZE (username length) to 512
diff --git a/mux.c b/mux.c
index 3f5babccc..70c8d2ade 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mux.c,v 1.18 2010/05/16 12:55:51 markus Exp $ */ 1/* $OpenBSD: mux.c,v 1.19 2010/06/17 07:07:30 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -931,7 +931,7 @@ mux_master_read_cb(Channel *c)
931 931
932 /* Setup ctx and */ 932 /* Setup ctx and */
933 if (c->mux_ctx == NULL) { 933 if (c->mux_ctx == NULL) {
934 state = xcalloc(1, sizeof(state)); 934 state = xcalloc(1, sizeof(*state));
935 c->mux_ctx = state; 935 c->mux_ctx = state;
936 channel_register_cleanup(c->self, 936 channel_register_cleanup(c->self,
937 mux_master_control_cleanup_cb, 0); 937 mux_master_control_cleanup_cb, 0);