mirror of
https://github.com/troglobit/libite.git
synced 2026-10-01 13:32:42 +07:00
copyfile(): Check return value of fstat(), prevent faulty futimens()
Found by Coverity Scan Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+3
-1
@@ -85,7 +85,9 @@ static void set_mtime(int in, int out)
|
||||
struct stat st;
|
||||
struct timespec tv[2];
|
||||
|
||||
fstat(in, &st);
|
||||
if (fstat(in, &st))
|
||||
return;
|
||||
|
||||
tv[0] = st.st_atim;
|
||||
tv[1] = st.st_mtim;
|
||||
futimens(out, tv);
|
||||
|
||||
Reference in New Issue
Block a user