Skip to content
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

org.dcm4che3.mime.MultipartInputStream - wrong byte to int conversion on read() #832

Closed
navrkalpavel opened this issue Nov 20, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@navrkalpavel
Copy link

The method org.dcm4che3.mime.MultipartInputStream.read() incorrectly handles byte to int conversion:


public int read() throws IOException {
       return isBoundary() ? -1 : buffer[rpos++];
}

The right conversion is:

public int read() throws IOException {
        return isBoundary() ? -1 : (buffer[rpos++] & 0xff);
}

See https://github.com/openjdk-mirror/jdk7u-jdk/blob/f4d80957e89a19a29bb9f9807d2a28351ed7f7df/src/share/classes/java/io/ByteArrayInputStream.java#L144

Pavel Navrkal

@gunterze gunterze self-assigned this Nov 24, 2020
@gunterze gunterze added the bug label Nov 24, 2020
@gunterze gunterze added this to the 5.23.0 milestone Nov 24, 2020
@gunterze
Copy link
Member

Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants