Skip to content

Input sizes longer that 127 bytes are failing

Corpus mutation 13 Replace an ascii digit with another digit looks for decimal integer positions. But the int position of each digit in the byte array is casted to byte. If input has digits located after byte 127 position, their offsets will be negative in Corups.java:135 digits.add((byte)k);.

Actual error happens in line 333: int was = res[digits.get(pos)];, where the position of an integer (not its value!) is returned negative.

java.lang.ArrayIndexOutOfBoundsException: Index -126 out of bounds for length 144

	at dev.fuzzit.javafuzz.core.Corpus.mutate(Corpus.java:333)
	at dev.fuzzit.javafuzz.core.Corpus.generateInput(Corpus.java:90)
	at dev.fuzzit.javafuzz.core.Fuzzer.start(Fuzzer.java:69)

Suggestion: don't cast int to byte and replace List<Byte> with List<Integer>

Edited by Alexander Kosenkov