In api_pipe_bind_req(), decode the bind request before checking the pipe
authorVolker Lendecke <vl@samba.org>
Wed, 16 Jul 2008 20:08:59 +0000 (22:08 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 16 Jul 2008 21:19:47 +0000 (23:19 +0200)
(This used to be commit 8be41382ed9bb4fb44a1846fff2c7652388e4f28)

source3/rpc_server/srv_pipe.c

index 80e2b2f9a92196dec1231345b86831970097807a..f8ec4bfc91d442367d7b69e2a2bacfe3fa77ed90 100644 (file)
@@ -1565,6 +1565,16 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
 
        DEBUG(5,("api_pipe_bind_req: decode request. %d\n", __LINE__));
 
+       ZERO_STRUCT(hdr_rb);
+
+       /* decode the bind request */
+
+       if(!smb_io_rpc_hdr_rb("", &hdr_rb, rpc_in_p, 0))  {
+               DEBUG(0,("api_pipe_bind_req: unable to unmarshall RPC_HDR_RB "
+                        "struct.\n"));
+               goto err_exit;
+       }
+
        /*
         * Try and find the correct pipe name to ensure
         * that this is a pipe name we support.
@@ -1606,14 +1616,6 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
                }
        }
 
-       ZERO_STRUCT(hdr_rb);
-
-       /* decode the bind request */
-       if(!smb_io_rpc_hdr_rb("", &hdr_rb, rpc_in_p, 0))  {
-               DEBUG(0,("api_pipe_bind_req: unable to unmarshall RPC_HDR_RB struct.\n"));
-               goto err_exit;
-       }
-
        /* name has to be \PIPE\xxxxx */
        fstrcpy(ack_pipe_name, "\\PIPE\\");
        fstrcat(ack_pipe_name, p->pipe_srv_name);