Closed
Description
(note: inspired by issues like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50065 uncovered by oss-fuzz)
Currently many of the write methods, like:
public void writeRaw(char[] text, int offset, int len);
in JsonGenerator
do not explicitly check validity of offset
and len
wrt to input buffer (text
).
So they will fail for things like ArrayIndexOutOfBounds exception, possibly after writing some of the content.
It would make more sense to validate bounds first and give meaningful exception instead (StreamWriteException
).