[router] fix assert when encoding metadata #13511
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Asra Ali [email protected]
Commit Message: Fix an invalid ASSERT when encoding metadata frames in the router.
Additional Description:
METADATA frames can't end stream, so there must be data, trailers, or a reset stream frame to end the stream. The ASSERT was meant to verify that there is data following METADATA frames to end the stream (for example, in case a client sends headers only request and metadata is added, FM adds empty data to end the stream). However, trailers could also end the stream, or the client could send body later/never. The ASSERT is invalid.
The PR removes the ASSERT.
Open to suggestions to have an ASSERT, but I couldn't think of one that was worth it / could be detected here. "if we had a header only request before, ASSERT there is empty data", or "if there is no possibility of stream reset occurring at this stage, ASSERT there is data or trailers."
Risk Level: Low. This only affects the ASSERT, has no impact on traffic.
Testing: Integration test added as a regression. Fuzz testcase added.
Fixes:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26238