Skip to content

Commit

Permalink
[fuzz]added an input check in writefilter fuzzer and added test cases (
Browse files Browse the repository at this point in the history
…#12628)

Added a handle for nullptr in HeaderPercentageProvider::percentage to avoid crash in mongo_proxy.
Added many unit test cases into corpus so that the coverage can be improved. All those filters' coverage was increased by 20%-40%.
Signed-off-by: jianwen <[email protected]>
  • Loading branch information
jianwen612 authored Aug 14, 2020
1 parent 630511e commit 9f95dda
Show file tree
Hide file tree
Showing 54 changed files with 1,173 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/extensions/filters/common/fault/fault_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ namespace Fault {

envoy::type::v3::FractionalPercent
HeaderPercentageProvider::percentage(const Http::RequestHeaderMap* request_headers) const {
if (request_headers == nullptr) {
// If request_headers is nullptr, return the default percentage.
return percentage_;
}
const auto header = request_headers->get(header_name_);
if (header == nullptr) {
return percentage_;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f95dda

Please sign in to comment.