r3255: - fixed 2 uninitialised data errors found with valgrind
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 Oct 2004 09:31:11 +0000 (09:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:04:47 +0000 (13:04 -0500)
- fixed offset of setup words in nttrans reply

source/ntvfs/posix/pvfs_ioctl.c
source/smb_server/nttrans.c

index 4feca8979f5b3b2747175f6eca519400d069d709..3eb016c5b4287ed79783c0b8300bea8655cbd02c 100644 (file)
@@ -50,6 +50,7 @@ static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
        case FSCTL_SET_SPARSE:
                /* maybe some posix systems have a way of marking
                   a file non-sparse? */
+               io->ntioctl.out.blob = data_blob(NULL, 0);
                return NT_STATUS_OK;
        }
 
@@ -62,7 +63,7 @@ static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_ioctl(struct ntvfs_module_context *ntvfs,
                    struct smbsrv_request *req, union smb_ioctl *io)
 {
-       NTSTATUS status;
+       NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
 
        switch (io->generic.level) {
        case RAW_IOCTL_IOCTL:
index 9e2b16c30e41fe19ed0858a9b36cabe57d73e6b5..5a5d9f77e3e65e88837d6e32c27ea39c23821c65 100644 (file)
@@ -221,6 +221,8 @@ void reply_nttrans(struct smbsrv_request *req)
 
                req_grow_data(req, this_param + this_data + (align1 + align2));
 
+               SSVAL(req->out.vwv, 0, 0); /* reserved */
+               SCVAL(req->out.vwv, 2, 0); /* reserved */
                SIVAL(req->out.vwv, 3, trans.out.params.length);
                SIVAL(req->out.vwv, 7, trans.out.data.length);
 
@@ -235,7 +237,7 @@ void reply_nttrans(struct smbsrv_request *req)
 
                SCVAL(req->out.vwv, 35, trans.out.setup_count);
                for (i=0;i<trans.out.setup_count;i++) {
-                       SSVAL(req->out.vwv, VWV(18+i)+1, trans.out.setup[i]);
+                       SSVAL(req->out.vwv, VWV(18+i), trans.out.setup[i]);
                }
 
                memset(req->out.data, 0, align1);