s3:librpc/rpc: allow up to DCERPC_AUTH_PAD_ALIGNMENT padding bytes in dcerpc_add_auth...
[samba.git] / 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;