Skip to content
Browse files

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@
  • Loading branch information...
1 parent d02587d commit 1f9c68d31fdf65e13e10322cb327682bf4fec1e2 tuexen committed Aug 15, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 sys/netinet/sctp_output.c
View
8 sys/netinet/sctp_output.c
@@ -5410,6 +5410,14 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
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);

0 comments on commit 1f9c68d

Please sign in to comment.
Something went wrong with that request. Please try again.