From: Volker Lendecke Date: Mon, 10 Sep 2018 12:53:37 +0000 (+0200) Subject: smbd: Add some structure protection for durable reconnect X-Git-Tag: tdb-1.3.17~1630 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e4f34e707709ba84be30cd271b10033989b0cbb;p=thirdparty%2Fsamba.git smbd: Add some structure protection for durable reconnect 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index 80392e2c6db..1f6113e4cc9 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -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;