Skip to content

Commit 196bf76

Browse files
nareddytvitalybuka
authored andcommitted
Allow unknown fields in corpus parser
As discussed in envoyproxy/envoy#10796, this will allow breaking wire-compatibility changes in the input proto. The pre-existing corpus will still function, but old fields will be ignored. Risk: Typos in the text proto will cause the fuzzer to run on an incomplete proto. Previously, this would log an error message and skip fuzzing with that test case.
1 parent f48c32b commit 196bf76

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/text_format.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ bool ParseTextMessage(const std::string& data, protobuf::Message* output) {
3030
TextFormat::Parser parser;
3131
parser.SetRecursionLimit(100);
3232
parser.AllowPartialMessage(true);
33+
parser.AllowUnknownField(true);
3334
if (!parser.ParseFromString(data, output)) {
3435
output->Clear();
3536
return false;

0 commit comments

Comments
 (0)