Closed ttasa closed 2 years ago
FYI, FILENAME_MAX
shouldn't be used to reserve space in this way (see here).
Allocating this space dynamically based on the length of the actual filename is probably the best way to go (though setting it to something very large, like 1K will likely fix most issues).
Also, strncpy
would work as opposed to writing a new copy function as long as you guarantee there is enough space in mat_name
for the given filename.
Thank you very much for pointing this problem out. I resolved it with another way.
Fixed size limits on the length of the (-a) weight matrix file name causing a buffer overflow.