Author: jelmer
Date: 2005-08-20 23:36:43 +0000 (Sat, 20 Aug 2005)
New Revision: 9439

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9439

Log:
Make sure the remainder of the array is always initialized if the buffer is 
larger then the string to be pushed. 

Modified:
   branches/SAMBA_4_0/source/librpc/ndr/ndr_string.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_string.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr_string.c   2005-08-20 23:30:10 UTC 
(rev 9438)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr_string.c   2005-08-20 23:36:43 UTC 
(rev 9439)
@@ -650,7 +650,13 @@
                return ndr_push_error(ndr, NDR_ERR_CHARCNV, 
                                      "Bad character conversion");
        }
-       ndr->offset += ret;
 
+       /* Make sure the remaining part of the string is filled with zeroes */
+       if (ret < (byte_mul*length)) {
+               memset(ndr->data+ndr->offset+ret, 0, (byte_mul*length)-ret);
+       }
+
+       ndr->offset += length;
+
        return NT_STATUS_OK;
 }

Reply via email to