s3:librpc/rpc: allow up to DCERPC_AUTH_PAD_ALIGNMENT padding bytes in dcerpc_add_auth...
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Jun 2015 14:55:39 +0000 (16:55 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Jun 2015 12:38:53 +0000 (14:38 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/librpc/rpc/dcerpc_helpers.c

index a9b24c8ec4d39bce686de2baa17383fb1d1c1c07..5f2b94cadfe173af75ab857f9d2d0d93e01fb05c 100644 (file)
@@ -422,7 +422,7 @@ NTSTATUS dcerpc_add_auth_footer(struct pipe_auth_data *auth,
                                size_t pad_len, DATA_BLOB *rpc_out)
 {
        struct gensec_security *gensec_security;
-       char pad[CLIENT_NDR_PADDING_SIZE] = { 0, };
+       const char pad[DCERPC_AUTH_PAD_ALIGNMENT] = { 0, };
        DATA_BLOB auth_info;
        DATA_BLOB auth_blob;
        NTSTATUS status;
@@ -432,6 +432,8 @@ NTSTATUS dcerpc_add_auth_footer(struct pipe_auth_data *auth,
        }
 
        if (pad_len) {
+               SMB_ASSERT(pad_len <= ARRAY_SIZE(pad));
+
                /* Copy the sign/seal padding data. */
                if (!data_blob_append(NULL, rpc_out, pad, pad_len)) {
                        return NT_STATUS_NO_MEMORY;