Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[redis_proxy] added a constraint for route.prefix().size() #12637

Merged
merged 14 commits into from
Aug 14, 2020
Merged
5 changes: 5 additions & 0 deletions source/extensions/filters/network/redis_proxy/router_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ PrefixRoutes::PrefixRoutes(
: nullptr) {

for (auto const& route : config.routes()) {
if(route.prefix().size() > 1000){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be a PGV annotation?

Copy link
Contributor Author

@jianwen612 jianwen612 Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be a PGV annotation?

Oh I can make it part of PGV. Do you think 1000 is ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

// Avoid a stack overflow issue when prefix_loopup_table_'s depth is great and default
// destructor recursively collects unique_ptr.
throw EnvoyException(fmt::format("prefix size is too long: size = {}", route.prefix().size()));
}
std::string copy(route.prefix());

if (case_insensitive_) {
Expand Down

Large diffs are not rendered by default.