Earlier check for settings flood

This commit is contained in:
James M Snell 2020-04-19 09:12:24 -07:00
parent 336a98feb0
commit f8da73bd04
No known key found for this signature in database
GPG Key ID: 7341B15C070877AC
1 changed files with 6 additions and 0 deletions

View File

@ -5653,6 +5653,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
break; break;
} }
/* Check the settings flood counter early to be safe */
if (session->obq_flood_counter_ >= session->max_outbound_ack &&
!(iframe->frame.hd.flags & NGHTTP2_FLAG_ACK)) {
return NGHTTP2_ERR_FLOODED;
}
iframe->state = NGHTTP2_IB_READ_SETTINGS; iframe->state = NGHTTP2_IB_READ_SETTINGS;
if (iframe->payloadleft) { if (iframe->payloadleft) {