Replace a DCHECK with a parse failure in connection ID parsing
This issue was found by ClusterFuzz:
https://bugs.chromium.org/p/chromium/issues/detail?id=962900
On the client, when parsing an IETF long header, we do not expect there to be a destination connection ID as we do not support client connection IDs yet. Instead of having a DCHECK to verify that, we should fail parsing with QUIC_INVALID_PACKET_HEADER.
gfe-relnote: change how client reacts to a type of invalid packet, client-only.
PiperOrigin-RevId: 248442467
Change-Id: Ie13868e5c45c0868c0f0d8655546ea927d705753
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index f0954d1..b686068 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -2699,8 +2699,13 @@
if (!GetQuicRestartFlag(quic_do_not_override_connection_id)) {
if (header->source_connection_id_included == CONNECTION_ID_PRESENT) {
+ DCHECK_EQ(Perspective::IS_CLIENT, perspective_);
+ DCHECK_EQ(IETF_QUIC_LONG_HEADER_PACKET, header->form);
+ if (!header->destination_connection_id.IsEmpty()) {
+ set_detailed_error("Client connection ID not supported yet.");
+ return false;
+ }
// Set destination connection ID to source connection ID.
- DCHECK_EQ(EmptyQuicConnectionId(), header->destination_connection_id);
header->destination_connection_id = header->source_connection_id;
} else if (header->destination_connection_id_included ==
CONNECTION_ID_ABSENT) {