-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadContentInputStream.read() method returning wrong values #2800
Comments
This method is returning wrong values and can signal EOF before reaching it. |
lfcnassif
changed the title
Bug in ReadContentInputStream.read() method can signal false EOF early
Bug in ReadContentInputStream.read() method returning wrong values
Feb 10, 2023
lfcnassif
changed the title
Bug in ReadContentInputStream.read() method returning wrong values
ReadContentInputStream.read() method returning wrong values
Feb 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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;
The text was updated successfully, but these errors were encountered: