s4-smb2: Fix a talloc crash bug.
authorAndreas Schneider <asn@samba.org>
Wed, 11 Apr 2012 12:15:54 +0000 (14:15 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 11 Apr 2012 13:59:39 +0000 (15:59 +0200)
The talloc context needs to be initialzed or NULL. So move
talloc_steal() to the position where req is initialized.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Apr 11 15:59:39 CEST 2012 on sn-devel-104

source4/smb_server/smb2/receive.c

index 3b54c977f240b1b32ae3ed69301b364874007719..19ab20b94131499222494a82429f3f09625f6aa3 100644 (file)
@@ -164,8 +164,6 @@ static void smb2srv_chain_reply(struct smb2srv_request *p_req)
        uint32_t flags;
        uint32_t last_hdr_offset;
 
-       talloc_steal(req, p_req);
-
        last_hdr_offset = p_req->in.hdr - p_req->in.buffer;
 
        chain_offset = p_req->chain_offset;
@@ -192,6 +190,8 @@ static void smb2srv_chain_reply(struct smb2srv_request *p_req)
                return;
        }
 
+       talloc_steal(req, p_req);
+
        req->in.buffer          = talloc_steal(req, p_req->in.buffer);
        req->in.size            = p_req->in.size;
        req->request_time       = p_req->request_time;