smbd: Add some structure protection for durable reconnect
authorVolker Lendecke <vl@samba.org>
Mon, 10 Sep 2018 12:53:37 +0000 (14:53 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Sep 2018 05:49:13 +0000 (07:49 +0200)
We should consume all data, and the ndr_pull function fills in all
fields. Thus the ZERO_STRUCT(cookie) is not required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/durable.c

index 80392e2c6dbbdd30eefe2404e437172265de209d..1f6113e4cc9d2953250131a01d194615d7e6a645 100644 (file)
@@ -546,10 +546,11 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
         * call below.
         */
 
-       ZERO_STRUCT(cookie);
-
-       ndr_err = ndr_pull_struct_blob(&old_cookie, talloc_tos(), &cookie,
-                       (ndr_pull_flags_fn_t)ndr_pull_vfs_default_durable_cookie);
+       ndr_err = ndr_pull_struct_blob_all(
+               &old_cookie,
+               talloc_tos(),
+               &cookie,
+               (ndr_pull_flags_fn_t)ndr_pull_vfs_default_durable_cookie);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
                return status;