Sorry... I was stupid.:) The current code is already zeroing the extra character and I just shifted it beyond the allocated memory.
Kornél ----- Original Message ----- From: "Kornél Pál" <[EMAIL PROTECTED]> To: <mono-devel-list@lists.ximian.com> Sent: Wednesday, July 12, 2006 2:59 PM Subject: Re: [PATCH] NULL terminate new strings beyond the end (rather than last char) > Hi, > > This modification seems to be wrong. > But in this case what is the extra character for? > > Kornél > > ----- Original Message ----- > From: "Kornél Pál" <[EMAIL PROTECTED]> > To: <mono-devel-list@lists.ximian.com> > Sent: Wednesday, July 12, 2006 12:24 PM > Subject: [PATCH] NULL terminate new strings beyond the end (rather than > last > char) > > >> Hi, >> >> Strings are allocated with an extra character. I think this is added to >> have >> a NULL at the end anyway. But when the allocated memory is not >> zero-filled >> by the GC, only the last character of the string is zeroed that can be >> and >> most likely will be overwritten. >> >> Please review and approve the patch. >> >> Kornél >> > _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list