marian-dev icon indicating copy to clipboard operation
marian-dev copied to clipboard

Lack of error checking in cnpy

Open kpu opened this issue 4 years ago • 2 comments

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

kpu avatar May 23 '20 20:05 kpu

Please add an fflush() and check on that, and don't check on fclose().

frankseide avatar May 23 '20 23:05 frankseide

Any takers for this?

emjotde avatar Nov 10 '20 02:11 emjotde