Author: tridge Date: 2005-07-17 09:13:05 +0000 (Sun, 17 Jul 2005) New Revision: 8519
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8519 Log: better method of ensuring null termination Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c =================================================================== --- branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2005-07-17 09:08:19 UTC (rev 8518) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2005-07-17 09:13:05 UTC (rev 8519) @@ -156,6 +156,9 @@ DATA_BLOB blob; blob.data = ndr->data; blob.length = ndr->offset; + if (ndr->alloc_size > ndr->offset) { + ndr->data[ndr->offset] = 0; + } return blob; } @@ -166,7 +169,6 @@ NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32_t size) { if (ndr->alloc_size > size) { - ndr->data[size] = 0; return NT_STATUS_OK; }