[xDS] fix fuzzer-found failure in ClusterSpecifierPlugin handling (#33552)

Fixes b/288542307.
pull/33554/head
Mark D. Roth 2 years ago committed by GitHub
parent e3c22b944b
commit ababacd5fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/ext/xds/xds_route_config.cc
  2. 26
      test/core/xds/xds_client_corpora/rls_missing_typed_extension_config

@ -349,6 +349,10 @@ XdsRouteConfigResource::ClusterSpecifierPluginMap ClusterSpecifierPluginParse(
const envoy_config_core_v3_TypedExtensionConfig* typed_extension_config =
envoy_config_route_v3_ClusterSpecifierPlugin_extension(
cluster_specifier_plugin[i]);
if (typed_extension_config == nullptr) {
errors->AddError("field not present");
continue;
}
std::string name = UpbStringToStdString(
envoy_config_core_v3_TypedExtensionConfig_name(typed_extension_config));
if (cluster_specifier_plugin_map.find(name) !=

@ -0,0 +1,26 @@
bootstrap: "{\"xds_servers\": [{\"server_uri\":\"xds.example.com:-257\", \"channel_creds\":[{\"type\": \"fake\"}]}]}"
actions {
start_watch {
resource_type {
route_config {
}
}
}
}
actions {
send_message_to_client {
stream_id {
ads {
}
}
response {
version_info: "grpc.lookup.v1.RouteLookup"
resources {
type_url: "envoy.config.route.v3.RouteConfiguration"
value: "\010\001b\000"
}
type_url: "envoy.config.route.v3.RouteConfiguration"
nonce: "/@\001\000\\\000\000x141183468234106731687303715884105729"
}
}
}
Loading…
Cancel
Save