Menu

#41 locks up for truncated files

master
closed-fixed
tbeu
None
5
2021-04-10
2019-07-21
John Cupitt
No

Hello, thank you for this nice lib.

This loop will run endlessly if fread() returns zero (no more bytes in file):

https://sourceforge.net/p/matio/matio/ci/master/tree/src/inflate.c#l646

To reproduce:

wget https://github.com/libvips/libvips/raw/master/test/test-suite/images/sample.mat
head -c 10000 sample.mat > truncated.mat

Now try to load truncated.mat. Tested with 1.5.17 and 1.5.11 on WIndows and Linux.

Discussion

  • tbeu

    tbeu - 2021-04-10
    • status: open --> closed-fixed
     
  • tbeu

    tbeu - 2021-04-10

    Resolved by v1.5.18.

     
  • tbeu

    tbeu - 2021-04-10
    • assigned_to: tbeu
     

Log in to post a comment.

MongoDB Logo MongoDB