Add explicit bounds checks for JsonGenerator
methods that take byte[]
/char[]
/String-with-offsets input
#811
Milestone
JsonGenerator
methods that take byte[]
/char[]
/String-with-offsets input
#811
(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:
in
JsonGenerator
do not explicitly check validity ofoffset
andlen
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
).The text was updated successfully, but these errors were encountered: