summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_auth.c')
-rw-r--r--sys/netinet/sctp_auth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c
index 71715cc..6da97ec 100644
--- a/sys/netinet/sctp_auth.c
+++ b/sys/netinet/sctp_auth.c
@@ -1645,8 +1645,10 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m,
bcopy(p_random->random_data, new_key->key, random_len);
}
#else
- keylen = sizeof(*p_random) + random_len + sizeof(*chunks) + num_chunks +
- sizeof(*hmacs) + hmacs_len;
+ keylen = sizeof(*p_random) + random_len + sizeof(*hmacs) + hmacs_len;
+ if (chunks != NULL) {
+ keylen += sizeof(*chunks) + num_chunks;
+ }
new_key = sctp_alloc_key(keylen);
if (new_key != NULL) {
/* copy in the RANDOM */
OpenPOWER on IntegriCloud