marian-dev
marian-dev copied to clipboard
Lack of error checking in cnpy
The 3rd-party cnpy code lacks error checking on functions that can fail like fseek
, fwrite
, and fclose
.
https://github.com/marian-nmt/marian-dev/blob/e9aa7ad340bc3e407add08ef5015f3cbf7e00485/src/3rd_party/cnpy/cnpy.cpp#L112 https://github.com/marian-nmt/marian-dev/blob/e9aa7ad340bc3e407add08ef5015f3cbf7e00485/src/3rd_party/cnpy/cnpy.h#L212-L218
Please add an fflush() and check on that, and don't check on fclose().
Any takers for this?