ReadContentInputStream.read() method returning wrong values
lfcnassif opened this issue · comments
The InputStream.read()
contract says it should return a byte as an unsigned int in [0, 255] range when EOF is not reached. The current implementation is:
https://github.com/sleuthkit/sleuthkit/blob/sleuthkit-4.12.0/bindings/java/src/org/sleuthkit/datamodel/ReadContentInputStream.java#L41-L42
Last line should be fixed to:
return (read(buff) != -1) ? buff[0] & 0xFF : -1;
This method is returning wrong values and can signal EOF before reaching it.