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)
committerKarolin Seeger <kseeger@samba.org>
Sat, 11 Jul 2015 19:59:25 +0000 (21:59 +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>
(cherry picked from commit 3e6e9e3acd17531148457be59a32727fb87ae43d)

source3/librpc/rpc/dcerpc_helpers.c

index a55e419fc136c06045fc95abe79c5c81e02d971c..aec275e422efc1058803ce3c3defa130560693ed 100644 (file)
@@ -553,7 +553,7 @@ NTSTATUS dcerpc_add_auth_footer(struct pipe_auth_data *auth,
 {
        struct schannel_state *schannel_auth;
        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;
@@ -564,6 +564,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;