diff options
author | Tim Potter <tpot@samba.org> | 2002-02-27 18:06:47 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-02-27 18:06:47 +0000 |
commit | b1d56956fec0de0e8591d85eb5eeec939494e6d4 (patch) | |
tree | 3a5e85cb7660b1af5bf71ae1574ccfd6bc01aa06 | |
parent | 9dae1398b45515e5b93de038ec18df297d73026d (diff) | |
download | samba-b1d56956fec0de0e8591d85eb5eeec939494e6d4.tar.gz samba-b1d56956fec0de0e8591d85eb5eeec939494e6d4.tar.xz samba-b1d56956fec0de0e8591d85eb5eeec939494e6d4.zip |
Fixed usage of uninitialised variable in strict_allocate_ftruncate()
-rw-r--r-- | source/smbd/vfs-wrap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/smbd/vfs-wrap.c b/source/smbd/vfs-wrap.c index 50cf42e248f..15d9572d1db 100644 --- a/source/smbd/vfs-wrap.c +++ b/source/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; |