From 12b6c1f57db772679cfb4b640a3f3dba259c9c72 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Aug 2008 17:37:08 +0200 Subject: [PATCH] Fix andx offset calculation for more than 2 chained requests Untested code is broken code.... Test follows later, it's quite an intrusive change to libsmb/ (This used to be commit 0ff16e8573f3c312f10fc723648319fa1f514ac0) --- source3/smbd/process.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index da1165219b5..a1d2d88b3dd 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1696,7 +1696,7 @@ void chain_reply(struct smb_request *req) * remember how much the caller added to the chain, only counting * stuff after the parameter words */ - chain_size += outsize_padded - smb_wct; + chain_size += (outsize_padded - smb_wct); /* * work out pointers into the original packets. The @@ -1825,6 +1825,12 @@ void chain_reply(struct smb_request *req) SAFE_FREE(caller_output); TALLOC_FREE(req2); + /* + * Reset the chain_size for our caller's offset calculations + */ + + chain_size -= (outsize_padded - smb_wct); + return; } -- 2.11.4.GIT