diff options
author | Matt Morehouse <mascasa@google.com> | 2018-02-02 20:22:20 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-02-02 20:22:20 +0000 |
commit | fea5007e11197e02959e9ec135098e9fe56e2c9c (patch) | |
tree | c7b258efd17611fd7ffd5cbbbba1f6ca1afc69ec /tools/clang-fuzzer | |
parent | dca2f9dcbaf981e7d07eefcbc59901fd3a4f5770 (diff) |
[clang-proto-to-cxx] Accept protobufs with missing fields.
libprotobuf-mutator accepts protobufs with missing fields, which means
clang-proto-fuzzer does as well. clang-proto-to-cxx should match this
behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-fuzzer')
-rw-r--r-- | tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp b/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp index cd75e0c99c..4a86515f55 100644 --- a/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp +++ b/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp @@ -94,7 +94,7 @@ std::string FunctionToString(const Function &input) { } std::string ProtoToCxx(const uint8_t *data, size_t size) { Function message; - if (!message.ParseFromArray(data, size)) + if (!message.ParsePartialFromArray(data, size)) return "#error invalid proto\n"; return FunctionToString(message); } |