From fa5d300d6b01032ece3f4d2dcf2391b6cc9a6ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 24 Aug 2012 03:30:51 +0200 Subject: [PATCH] nfs4: Fix timespec attribute allocation size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * copying the time attributes was fixed to copy the whole st_?tim timespec struct but the allocation size was still only that of st_?time subfield, which is only a time_t. Signed-off-by: François Revol Signed-off-by: Pawel Dziepak --- src/add-ons/kernel/file_systems/nfs4/Inode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/file_systems/nfs4/Inode.cpp b/src/add-ons/kernel/file_systems/nfs4/Inode.cpp index f303dfda43..31c519f8e3 100644 --- a/src/add-ons/kernel/file_systems/nfs4/Inode.cpp +++ b/src/add-ons/kernel/file_systems/nfs4/Inode.cpp @@ -628,16 +628,16 @@ Inode::WriteStat(const struct stat* st, uint32 mask, OpenAttrCookie* cookie) if ((mask & B_STAT_ACCESS_TIME) != 0) { attr[i].fAttribute = FATTR4_TIME_ACCESS_SET; attr[i].fFreePointer = true; - attr[i].fData.fPointer = malloc(sizeof(st->st_atime)); - memcpy(attr[i].fData.fPointer, &st->st_atime, sizeof(st->st_atim)); + attr[i].fData.fPointer = malloc(sizeof(st->st_atim)); + memcpy(attr[i].fData.fPointer, &st->st_atim, sizeof(st->st_atim)); i++; } if ((mask & B_STAT_MODIFICATION_TIME) != 0) { attr[i].fAttribute = FATTR4_TIME_MODIFY_SET; attr[i].fFreePointer = true; - attr[i].fData.fPointer = malloc(sizeof(st->st_mtime)); - memcpy(attr[i].fData.fPointer, &st->st_mtime, sizeof(st->st_mtim)); + attr[i].fData.fPointer = malloc(sizeof(st->st_mtim)); + memcpy(attr[i].fData.fPointer, &st->st_mtim, sizeof(st->st_mtim)); i++; }