diff --git a/src/quic_rx.c b/src/quic_rx.c index 69a36ec77c..c88a599ebf 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1079,6 +1079,12 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt, break; } } + + /* Always reset as it may be dangling after + * list_for_each_entry_safe() usage. Especially necessary to + * prevent a crash if loop is interrupted on max iteration. + */ + frm = NULL; } /* Error should be returned if some frames cannot be parsed. */