Skip to content

Commit 477a84b

Browse files
committed
BUG/MEDIUM: quic-be: avoid crashes when releasing Initial pktns
This bug arrived with this fix: BUG/MINOR: quic-be: missing Initial packet number space discarding leading to crashes when dereferencing ->ipktns. Such crashes could be reproduced with -dMfail option. To reach them, the memory allocations must fail. So, this is relatively rare, except on systems with limited memory. To fix this, do not call quic_pktns_discard() if ->ipktns is NULL. No need to backport.
1 parent c36e4fb commit 477a84b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quic_conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
916916
* discard Initial keys when it first sends a Handshake packet...
917917
*/
918918

919-
if (qc_is_back(qc) && !quic_tls_pktns_is_dcd(qc, qc->ipktns) &&
919+
if (qc_is_back(qc) && qc->ipktns && !quic_tls_pktns_is_dcd(qc, qc->ipktns) &&
920920
qc->hpktns && qc->hpktns->tx.in_flight > 0) {
921921
/* Discard the Initial packet number space. */
922922
TRACE_PROTO("discarding Initial pktns", QUIC_EV_CONN_PRSHPKT, qc);

0 commit comments

Comments
 (0)