Skip to content

Commit e4fd69d

Browse files
test: avoid use after free in oauth_integration_test (envoyproxy#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 envoyproxy#12960 Signed-off-by: Antonio Vicente <[email protected]>
1 parent bf17295 commit e4fd69d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/extensions/filters/http/oauth2/oauth_integration_test.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ TEST_F(OauthIntegrationTest, UnauthenticatedFlow) {
9191
{":authority", "authority"}};
9292
auto encoder_decoder = codec_client_->startRequest(headers);
9393

94-
Buffer::OwnedImpl buffer;
95-
encoder_decoder.first.encodeData(buffer, true);
9694
request_encoder_ = &encoder_decoder.first;
9795
auto response = std::move(encoder_decoder.second);
9896

@@ -144,4 +142,4 @@ TEST_F(OauthIntegrationTest, AuthenticationFlow) {
144142
} // namespace Oauth
145143
} // namespace HttpFilters
146144
} // namespace Extensions
147-
} // namespace Envoy
145+
} // namespace Envoy

0 commit comments

Comments
 (0)