Skip to content

Commit

Permalink
Fix the adding of padding to COOKIE-ECHO chunks.
Browse files Browse the repository at this point in the history
Thanks to Mark Wodrich who found this issue while fuzz testing the
usrsctp stack and reported the issue in
sctplab/usrsctp#382

MFC after:		3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@353119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
tuexen committed Oct 5, 2019
1 parent 29a4ce2 commit b497b46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sys/netinet/sctp_output.c
Expand Up @@ -9059,8 +9059,7 @@ sctp_send_cookie_echo(struct mbuf *m,
pad = 4 - pad;
}
if (pad > 0) {
cookie = sctp_pad_lastmbuf(cookie, pad, NULL);
if (cookie == NULL) {
if (sctp_pad_lastmbuf(cookie, pad, NULL) == NULL) {
return (-8);
}
}
Expand Down

0 comments on commit b497b46

Please sign in to comment.