BUG/MINOR: quic: Possible NULL pointer dereferencing when dumping streams.

This bug may occur when displaying streams traces. It came with this commit:
242fb1b63 ("MINOR: quic: Drop packets with STREAM frames with wrong direction.").
This commit is contained in:
Frédéric Lécaille 2021-01-11 15:10:06 +01:00 committed by Amaury Denoyelle
parent 6f97b4ef33
commit 577fe48890

View File

@ -574,14 +574,17 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
if (mask & QUIC_EV_CONN_PSTRM) {
const struct quic_frame *frm = a2;
const struct quic_stream *s = &frm->stream;
chunk_appendf(&trace_buf, " uni=%d fin=%d id=%llu off=%llu len=%llu",
!!(s->id & QUIC_STREAM_FRAME_ID_DIR_BIT),
!!(frm->type & QUIC_STREAM_FRAME_TYPE_FIN_BIT),
(unsigned long long)s->id,
(unsigned long long)s->offset,
(unsigned long long)s->len);
if (a2) {
const struct quic_stream *s = &frm->stream;
chunk_appendf(&trace_buf, " uni=%d fin=%d id=%llu off=%llu len=%llu",
!!(s->id & QUIC_STREAM_FRAME_ID_DIR_BIT),
!!(frm->type & QUIC_STREAM_FRAME_TYPE_FIN_BIT),
(unsigned long long)s->id,
(unsigned long long)s->offset,
(unsigned long long)s->len);
}
}
}
if (mask & QUIC_EV_CONN_LPKT) {