diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-02-06 18:16:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:43 -0500 |
commit | 2342219d699eb17d48a2b31c297121a158ba85d0 (patch) | |
tree | beeccc37a4d67b91bd4f1bcfbe0fe7ebb68c46bf | |
parent | 4aa1f83ca5629bb2a086c7431e8e96301f6af79f (diff) | |
download | samba-2342219d699eb17d48a2b31c297121a158ba85d0.tar.gz samba-2342219d699eb17d48a2b31c297121a158ba85d0.tar.bz2 samba-2342219d699eb17d48a2b31c297121a158ba85d0.zip |
r21183: Commit the big/little endian fix for nttrans setup[] handling.
Please check!
For code symmetry reasons, trans2 might also see this fix, but this is left to
the interested reader :-)
Volker
(This used to be commit f2d364ebe69fc5d624e456cc7d941071811a5567)
-rw-r--r-- | source4/libcli/raw/rawtrans.c | 6 | ||||
-rw-r--r-- | source4/smb_server/smb/nttrans.c | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c index cd309e0736..08d7483a87 100644 --- a/source4/libcli/raw/rawtrans.c +++ b/source4/libcli/raw/rawtrans.c @@ -555,7 +555,6 @@ struct smbcli_request *smb_raw_nttrans_send(struct smbcli_tree *tree, { struct smbcli_request *req; uint8_t *outdata, *outparam; - int i; int align = 0; /* only align if there are parameters or data */ @@ -592,9 +591,8 @@ struct smbcli_request *smb_raw_nttrans_send(struct smbcli_tree *tree, SIVAL(req->out.vwv, 31, PTR_DIFF(outdata,req->out.hdr)); SCVAL(req->out.vwv, 35, parms->in.setup_count); SSVAL(req->out.vwv, 36, parms->in.function); - for (i=0;i<parms->in.setup_count;i++) { - SSVAL(req->out.vwv,VWV(19+i),parms->in.setup[i]); - } + memcpy(req->out.vwv + VWV(19), parms->in.setup, + sizeof(uint16_t) * parms->in.setup_count); if (parms->in.params.length) { memcpy(outparam, parms->in.params.data, parms->in.params.length); } diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index fce4fdc129..e85da29806 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -570,7 +570,6 @@ void smbsrv_reply_nttrans(struct smbsrv_request *req) { struct nttrans_op *op; struct smb_nttrans *trans; - int i; uint16_t param_ofs, data_ofs; uint16_t param_count, data_count; uint16_t param_total, data_total; @@ -617,9 +616,9 @@ void smbsrv_reply_nttrans(struct smbsrv_request *req) smbsrv_send_error(req, NT_STATUS_NO_MEMORY); return; } - for (i=0;i<trans->in.setup_count;i++) { - trans->in.setup[i] = SVAL(req->in.vwv, VWV(19+i)); - } + + memcpy(trans->in.setup, (char *)(req->in.vwv) + VWV(19), + sizeof(uint16_t) * trans->in.setup_count); if (!req_pull_blob(req, req->in.hdr + param_ofs, param_count, &trans->in.params) || !req_pull_blob(req, req->in.hdr + data_ofs, data_count, &trans->in.data)) { |