Closed
Description
While ios_trunc accepts a size argument of type size_t
, it calls _chsize, which takes a long
(32-bit int on Windows), and it doesn't check for overflow. As a result, this fails:
open("some_file_name", "w") do f
truncate(f, 2^31+1)
end
ios_trunc
should probably be modified to use _chsize_s.
(Originally reported as JuliaIO/JLD2.jl#50.)