Closed jcupitt closed 3 years ago
Confirmed. Need to think about correct error handling.
Hopefully closed by v1.5.18. Please reopen if it is not good enough.
Thank you for doing all this work, @tbeu !
I'll add matio back to the fuzzer and see what happens.
Hello, thank you for this nice lib.
(I opened this issue on the sourceforge tracker before realizing that this one seems to be where the activity is. Sorry for the extra work.)
This loop will run endlessly if
fread()
returns zero (no more bytes in file), since it's not checkingfeof()
orferror()
:https://github.com/tbeu/matio/blob/master/src/inflate.c#L646
To reproduce:
Now try to load truncated.mat. Tested with 1.5.17 and 1.5.11 on Windows and Linux. Credit to @kleisauke for finding this.