From 9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 27 Feb 2002 18:06:47 +0000 Subject: Fixed usage of uninitialised variable in strict_allocate_ftruncate() (This used to be commit b1d56956fec0de0e8591d85eb5eeec939494e6d4) --- source3/smbd/vfs-wrap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c index 50cf42e248..15d9572d1d 100644 --- a/source3/smbd/vfs-wrap.c +++ b/source3/smbd/vfs-wrap.c @@ -486,7 +486,7 @@ static int strict_allocate_ftruncate(files_struct *fsp, int fd, SMB_OFF_T len) SMB_STRUCT_STAT st; SMB_OFF_T currpos = vfs_ops->lseek(fsp, fd, 0, SEEK_CUR); unsigned char zero_space[4096]; - SMB_OFF_T space_to_write = len - st.st_size; + SMB_OFF_T space_to_write; if (currpos == -1) return -1; @@ -494,6 +494,8 @@ static int strict_allocate_ftruncate(files_struct *fsp, int fd, SMB_OFF_T len) if (vfs_ops->fstat(fsp, fd, &st) == -1) return -1; + space_to_write = len - st.st_size; + #ifdef S_ISFIFO if (S_ISFIFO(st.st_mode)) return 0; -- cgit