-
Notifications
You must be signed in to change notification settings - Fork 112
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
Fix some unsafe reads. #659
Fix some unsafe reads. #659
Conversation
Test failures seem to be due to tests failing to pull in binaries to start the run? And something off in the Windows build, it seems? |
Just saw your previous comment afterward, so it may be unrelated to your changes |
Cantaloupe dev call 3rd July. Thanks changes look good and will look again once the library updates have been applied to develop. |
@adam-vessey would you be able to rebase this on the develop branch? That should allow all the tests to pass. Then we can look at merging this. |
If they failed to read the number of bytes, the return of `-1` would cause infinite loops, with `-1` always less than the minimum `offset` of `0`.
0948fd1
to
012e833
Compare
Taking a cursory look through the failing tests, generally seems to be testing failure conditions, expecting As in, something like: adam-vessey/cantaloupe@fix/unsafe-reads...adam-vessey:cantaloupe:fix/wrapped-reads ? Created a draft PR with it, to see what happens: #681 Seems to have done the trick over on #681 (not sure about whatever is happening with the linux/graalvm build; don't believe it's anything I did) |
@adam-vessey merged! dc7947a |
@DiegoPino : Closing this one in favour of #681, given the JPEG2000 metadata reader tests would still fail here without the changes being made there, or changes of some other nature (reworking the tests to more generic exceptions?). |
If they failed to read the number of bytes, the return of
-1
would cause infinite loops, with-1
always less than the minimumoffset
of0
.An alternative to #551 fixing #550, and more, touching on #551 (comment)
Did a bit of a
grep
around for similar broken patterns which should get a similar fix; though, there may be some others. In particular, suspicious of this bit ofJPEG2000KakaduImageReader
, but not terribly sure on the expectations around it, and don't use Kakadu.