-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Description
Hello!
I saw the recent update included support for setting the max elements (and a few other protections) for the reader based interface. Would you be open to adding this support via the generated code for the other msgp.Unmarshaler interface?
This would be useful for me in enabling fuzz testing where we make use of the msgp.Unmarshaler interface for performance reasons. Without these limits today fuzz testing isn't feasible as random inputs that allocate huge amounts of memory crash / stall the fuzzer.
I had a couple ideas on how one (possibly me?) could go about implementing this, but none stood out to me as "obviously the best"
- Add package variables to the generated code that can be set at runtime to limit the sizes of allocated slices/dicts/strings etc (These would be overriden by any value set in the "Reader" if that is being used)
- Add an option to the code generation itself where a fixed value is provided at compile time
I'm happy to give more details if needed, Thanks!
Metadata
Metadata
Assignees
Labels
No labels