cantaloupe icon indicating copy to clipboard operation
cantaloupe copied to clipboard

Fix some unsafe reads.

Open adam-vessey opened this issue 8 months ago • 3 comments

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.

An alternative to #551 fixing #550, and more, touching on https://github.com/cantaloupe-project/cantaloupe/pull/551#discussion_r1427377512

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 of JPEG2000KakaduImageReader, but not terribly sure on the expectations around it, and don't use Kakadu.

adam-vessey avatar Jun 06 '24 14:06 adam-vessey