Summary: | buggy read() in ChunkedCipherInputStream | ||
---|---|---|---|
Product: | POI | Reporter: | Tim Allison <tallison> |
Component: | POIFS | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 4.0.x-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Tim Allison
2019-05-14 19:27:56 UTC
Definitely looks like a bug to me. +1 for merging. Although ChunkedCipherInputStream::read(byte[], int, int, boolean) returns -1, if no more data can be fetched and so there's no result size of 0, I would rewrite the original code: if (read(b) == 1) { return b[0]; } return -1; to: return (read(b) == 1) ? b[0] : -1; |