Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 554993002: Fix a crash bug in QuicUnackedPacketMap when truncated acks arrived. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@send_an_ack_74741188
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map.cc
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index 4d2bec982d25af0dda22b3009735d926d1e58f14..7276b139e91bc7f223c40504c98187819a2c93a4 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -117,9 +117,24 @@ void QuicUnackedPacketMap::ClearPreviousRetransmissions(size_t num_to_clear) {
break;
}
- info->all_transmissions->pop_front();
- LOG_IF(DFATAL, info->all_transmissions->empty())
- << "Previous retransmissions must have a newer transmission.";
+ if (info->all_transmissions != NULL) {
+ if (info->all_transmissions->size() < 2) {
+ LOG(DFATAL) << "all_transmissions must be NULL or have multiple "
+ << "elements. size:" << info->all_transmissions->size();
+ delete info->all_transmissions;
+ } else {
+ info->all_transmissions->pop_front();
+ if (info->all_transmissions->size() == 1) {
+ // Set the newer transmission's 'all_transmissions' entry to NULL.
+ QuicPacketSequenceNumber new_transmission =
+ info->all_transmissions->front();
+ TransmissionInfo* new_info =
+ &unacked_packets_.at(new_transmission - least_unacked_);
+ delete new_info->all_transmissions;
+ new_info->all_transmissions = NULL;
+ }
+ }
+ }
unacked_packets_.pop_front();
++least_unacked_;
--num_to_clear;
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698