rpcrt4: Replace sizeofs with FIELD_OFFSET in RPCRT4_BuildBindNackHeader to avoid relying on ANYSIZE_ARRAY being 1.

This commit is contained in:
Rob Shearman 2009-11-12 10:31:00 +00:00 committed by Alexandre Julliard
parent 5487009624
commit 03f87bc1c3
1 changed files with 2 additions and 2 deletions

View File

@ -226,13 +226,13 @@ RpcPktHdr *RPCRT4_BuildBindNackHeader(ULONG DataRepresentation,
{
RpcPktHdr *header;
header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->bind_nack));
header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(RpcPktHdr, bind_nack.protocols[1]));
if (header == NULL) {
return NULL;
}
RPCRT4_BuildCommonHeader(header, PKT_BIND_NACK, DataRepresentation);
header->common.frag_len = sizeof(header->bind_nack);
header->common.frag_len = FIELD_OFFSET(RpcPktHdr, bind_nack.protocols[1]);
header->bind_nack.reject_reason = RejectReason;
header->bind_nack.protocols_count = 1;
header->bind_nack.protocols[0].rpc_ver = RpcVersion;