Skip to content

Commit

Permalink
test: avoid use after free in oauth_integration_test (envoyproxy#14103)
Browse files Browse the repository at this point in the history
The client request stream can be deleted under the call stack of Envoy::IntegrationCodecClient::startRequest if the proxy replies quickly enough. Attempts to send an end stream on that request result in use-after-free on the client stream in cases where the client processed the full reply inside startRequest.

Fixes envoyproxy#12960

Signed-off-by: Antonio Vicente <avd@google.com>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
  • Loading branch information
antoniovicente authored and cpakulski committed Nov 19, 2020
1 parent be5bd08 commit 6f741aa
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ TEST_F(OauthIntegrationTest, UnauthenticatedFlow) {
{":authority", "authority"}};
auto encoder_decoder = codec_client_->startRequest(headers);

Buffer::OwnedImpl buffer;
encoder_decoder.first.encodeData(buffer, true);
request_encoder_ = &encoder_decoder.first;
auto response = std::move(encoder_decoder.second);

Expand Down Expand Up @@ -144,4 +142,4 @@ TEST_F(OauthIntegrationTest, AuthenticationFlow) {
} // namespace Oauth
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
} // namespace Envoy

0 comments on commit 6f741aa

Please sign in to comment.