google / google/libprotobuf-mutator
Crash when using `CustomProtoMutator` for multiple protos
- Dominant language
- C++
- Stars
- 667
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
I have multiple protos that I need to mutate in a libFuzzer fuzz target and am thus calling `CustomProtoMutator` directly instead of using the macro. However, the `Swap` calls in the `LastMutationCache` crash when trying to swap out one proto for another:
```
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc:614] CHECK failed: (message2->GetReflection()) == (this): Second argument to Swap() (of type "some_proto") is not compatible with this reflection object (which is for type "some_other_proto"). Note that the exact same class is required; not just the same descriptor.
```
Patching out the cache resolved this issue. Would it be possible to either invalidate the cache if a new proto is mutated or add a way to disable the cache in `CustomProtoMutator` calls?
Contributor guide
Assessment
This issue has not been assessed yet.