javafuzz icon indicating copy to clipboard operation
javafuzz copied to clipboard

Byte overflow leading to index-out-of-bounds exception

Open smoelius opened this issue 5 years ago • 0 comments

Consider changing these instances of Byte to Integer: https://github.com/fuzzitdev/javafuzz/blob/342735adbed192870e61dd12342c8a1f94bc0519/core/src/main/java/dev/fuzzit/javafuzz/core/Corpus.java#L322 and eliminating this cast: https://github.com/fuzzitdev/javafuzz/blob/342735adbed192870e61dd12342c8a1f94bc0519/core/src/main/java/dev/fuzzit/javafuzz/core/Corpus.java#L325 It is easy to overflow a Byte. Moreover, because a Byte is signed, an overflow can result in a negative value and an ArrayIndexOutOfBoundsException on this line: https://github.com/fuzzitdev/javafuzz/blob/342735adbed192870e61dd12342c8a1f94bc0519/core/src/main/java/dev/fuzzit/javafuzz/core/Corpus.java#L333 Such was the case with a corpus I was using.

smoelius avatar Mar 01 '20 16:03 smoelius