From 61953ab35a59611e307d684a5f8dfa165e95053d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 24 Feb 2012 16:16:23 +0100 Subject: [PATCH] s3: Simplify smb_splice_chain No code change, just remove a {} block left over as the else branch from the previous commit Autobuild-User: Volker Lendecke Autobuild-Date: Fri Feb 24 18:07:48 CET 2012 on sn-devel-104 --- source3/smbd/process.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index bdfc10d2bd3..391ddc70baf 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1790,6 +1790,8 @@ static bool smb_splice_chain(uint8_t **poutbuf, const uint8_t *andx_buf) size_t old_size, new_size; size_t ofs; size_t chain_padding = 0; + size_t andx_cmd_ofs; + old_size = talloc_get_size(*poutbuf); @@ -1822,25 +1824,20 @@ static bool smb_splice_chain(uint8_t **poutbuf, const uint8_t *andx_buf) } *poutbuf = outbuf; - { - size_t andx_cmd_ofs; - - if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) { - DEBUG(1, ("invalid command chain\n")); - *poutbuf = talloc_realloc( - NULL, *poutbuf, uint8_t, old_size); - return false; - } - - if (chain_padding != 0) { - memset(outbuf + old_size, 0, chain_padding); - old_size += chain_padding; - } + if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) { + DEBUG(1, ("invalid command chain\n")); + *poutbuf = talloc_realloc(NULL, *poutbuf, uint8_t, old_size); + return false; + } - SCVAL(outbuf, andx_cmd_ofs, smb_command); - SSVAL(outbuf, andx_cmd_ofs + 2, old_size - 4); + if (chain_padding != 0) { + memset(outbuf + old_size, 0, chain_padding); + old_size += chain_padding; } + SCVAL(outbuf, andx_cmd_ofs, smb_command); + SSVAL(outbuf, andx_cmd_ofs + 2, old_size - 4); + ofs = old_size; /* -- 2.11.4.GIT