Skip to content

Commit

Permalink
pad to avoid crash when DATAGRAM does not fit into a QUIC packet
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Feb 19, 2021
1 parent cd9358c commit 6e88f86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -4212,6 +4212,10 @@ static int do_send(quicly_conn_t *conn, quicly_send_context_t *s)
if (s->dst_end - s->dst >= required_space) {
s->dst = quicly_encode_datagram_frame(s->dst, *payload);
QUICLY_PROBE(DATAGRAM_SEND, conn, conn->stash.now, payload->base, payload->len);
} else {
/* FIXME: At the moment, we add a padding because we do not have a way to reclaim allocated space, and because
* it is forbidden to send an empty QUIC packet. */
*s->dst++ = QUICLY_FRAME_TYPE_PADDING;
}
}
}
Expand Down

0 comments on commit 6e88f86

Please sign in to comment.