From 6f741aae583554e9a69f7c5823d600279e5fd411 Mon Sep 17 00:00:00 2001 From: antonio Date: Thu, 19 Nov 2020 13:12:06 -0800 Subject: [PATCH] test: avoid use after free in oauth_integration_test (#14103) 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 #12960 Signed-off-by: Antonio Vicente Signed-off-by: Christoph Pakulski --- test/extensions/filters/http/oauth2/oauth_integration_test.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/extensions/filters/http/oauth2/oauth_integration_test.cc b/test/extensions/filters/http/oauth2/oauth_integration_test.cc index 0788c5d2b3b9..f1ec679be091 100644 --- a/test/extensions/filters/http/oauth2/oauth_integration_test.cc +++ b/test/extensions/filters/http/oauth2/oauth_integration_test.cc @@ -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); @@ -144,4 +142,4 @@ TEST_F(OauthIntegrationTest, AuthenticationFlow) { } // namespace Oauth } // namespace HttpFilters } // namespace Extensions -} // namespace Envoy \ No newline at end of file +} // namespace Envoy