Apache OpenOffice (AOO) Bugzilla – Issue 128542
Bugs in the scripting module's XInputStreamImpl
Last modified: 2022-10-31 09:39:26 UTC
In main/scripting/java/com/sun/star/script/framework/io/XInputStreamImpl.java we need to: - Check the loop termination in readBytes() properly: currently it increments totalBytesRead while also decrementing nBytesToRead, so when compared to each other, the loop terminates when the buffer is half full. Only check for nBytesToRead instead. - Trim the sequence to the size actually read. - Deal with the possibility of available() returning 0 in readSomeBytes().
Fixed by commit 7e29bacc90c4b1b9788c3b71dfacd17daecde7a7, resolving fixed.
Cherry-picked for AOO42X with: https://github.com/apache/openoffice/commit/4313305f54da9ea9933f9bd443a549ffa6b66876
Cherry-picked for AOO41X with: https://github.com/apache/openoffice/commit/4271e4a8d1fe4fd139f365686585a11457a0b972