summaryrefslogtreecommitdiffstats
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-02-27 18:06:47 +0000
committerTim Potter <tpot@samba.org>2002-02-27 18:06:47 +0000
commit9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed (patch)
tree8e7f500525e275b0def8de49cbe65478250713f3 /source3/smbd/vfs-wrap.c
parentb06749d73cde4c65cbae8eb79fec01d7bcd3bbcf (diff)
downloadsamba-9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed.tar.gz
samba-9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed.tar.xz
samba-9e2a06611d5ab7e2dbba7e9fbc84e1fcae0c58ed.zip
Fixed usage of uninitialised variable in strict_allocate_ftruncate()
(This used to be commit b1d56956fec0de0e8591d85eb5eeec939494e6d4)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c4
1 files changed, 3 insertions, 1 deletions
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;