We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa78c3d commit 497d63fCopy full SHA for 497d63f
src/librustuv/file.rs
@@ -256,7 +256,9 @@ impl FsRequest {
256
let path = unsafe { Path::new(CString::new(path, false)) };
257
let stat = self.get_stat();
258
fn to_msec(stat: uvll::uv_timespec_t) -> u64 {
259
- (stat.tv_sec * 1000 + stat.tv_nsec / 1000000) as u64
+ // Be sure to cast to u64 first to prevent overflowing if the tv_sec
260
+ // field is a 32-bit integer.
261
+ (stat.tv_sec as u64) * 1000 + (stat.tv_nsec as u64) / 1000000
262
}
263
let kind = match (stat.st_mode as c_int) & libc::S_IFMT {
264
libc::S_IFREG => io::TypeFile,
0 commit comments