Index: content/browser/loader/resource_scheduler.cc |
diff --git a/content/browser/loader/resource_scheduler.cc b/content/browser/loader/resource_scheduler.cc |
index d24e484816c0152f3685345bc30c2c1fb0e87c4b..4ae240e6fe3207c2bc0096024a61674d62e5e580 100644 |
--- a/content/browser/loader/resource_scheduler.cc |
+++ b/content/browser/loader/resource_scheduler.cc |
@@ -374,7 +374,10 @@ void ResourceScheduler::LoadAnyStartablePendingRequests(Client* client) { |
StartRequest(request, client); |
// StartRequest can modify the pending list, so we (re)start evaluation |
- // from the currently highest priority request. |
+ // from the currently highest priority request. Avoid copying a singular |
+ // iterator, which would trigger undefined behavior. |
+ if (client->pending_requests.GetNextHighestIterator().is_null()) |
+ break; |
request_iter = client->pending_requests.GetNextHighestIterator(); |
} else if (query_result == DO_NOT_START_REQUEST_AND_KEEP_SEARCHING) { |
++request_iter; |