From 5993ad85d96997ab6256cc5ddff669e85f3fcc4b Mon Sep 17 00:00:00 2001 From: tuexen Date: Thu, 15 Aug 2013 05:14:20 +0000 Subject: [PATCH] MFC r254352: Don't send uninitialized memory (two instances of 4 bytes) in every cookie on the wire. This bug was reported in https://bugzilla.mozilla.org/show_bug.cgi?id=905080 Approved by: re@ git-svn-id: svn://svn.freebsd.org/base/releng/9.2@254355 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/sctp_output.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index dc7a10c0..c2993857 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5410,6 +5410,14 @@ do_a_abort: } SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + /* + * We might not overwrite the identification[] completely and on + * some platforms time_entered will contain some padding. Therefore + * zero out the cookie to avoid putting uninitialized memory on the + * wire. + */ + memset(&stc, 0, sizeof(struct sctp_state_cookie)); + /* the time I built cookie */ (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); -- 2.42.0