From cb8ac8c47b03833fa7eebcb2ce94801f13da2bd7 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 2 Jan 2023 02:21:18 +0100 Subject: libtrivfs: Avoid passing uninitialized seconds field Even if microseconds being -1 is enough, better not leak uninitialized values. --- libtrivfs/file-utimes.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libtrivfs/file-utimes.c b/libtrivfs/file-utimes.c index 7c5eaf43..d71c169f 100644 --- a/libtrivfs/file-utimes.c +++ b/libtrivfs/file-utimes.c @@ -45,12 +45,18 @@ trivfs_S_file_utimens (struct trivfs_protid *cred, time_value_t atim, mtim; if (atime.tv_nsec == UTIME_NOW) - atim.microseconds = -1; + { + atim.seconds = -1; + atim.microseconds = -1; + } else TIMESPEC_TO_TIME_VALUE (&atim, &atime); if (mtime.tv_nsec == UTIME_NOW) - mtim.microseconds = -1; + { + mtim.seconds = -1; + mtim.microseconds = -1; + } else TIMESPEC_TO_TIME_VALUE (&mtim, &mtime); -- cgit v1.2.3