Re: libedit wchar allocation issue

2011-11-17 Thread Nicholas Marriott
Sure, looks good, I'll use your version. On Wed, Nov 16, 2011 at 02:00:51PM +0100, Stefan Sperling wrote: > On Tue, Nov 15, 2011 at 11:09:08PM +, Nicholas Marriott wrote: > > Hi > > > > libedit miscalculates the amount of space needed for constructing it's > > wchar_t version of argv, causin

Re: libedit wchar allocation issue

2011-11-16 Thread Owain Ainsworth
On Tue, Nov 15, 2011 at 11:09:08PM +, Nicholas Marriott wrote: > Hi > > libedit miscalculates the amount of space needed for constructing it's > wchar_t version of argv, causing it to overrun the buffer. > > I don't see how the output of mbstowcs can be longer than > (sum(strlen(argv)) * size

Re: libedit wchar allocation issue

2011-11-16 Thread Stefan Sperling
On Tue, Nov 15, 2011 at 11:09:08PM +, Nicholas Marriott wrote: > Hi > > libedit miscalculates the amount of space needed for constructing it's > wchar_t version of argv, causing it to overrun the buffer. > > I don't see how the output of mbstowcs can be longer than > (sum(strlen(argv)) * size

libedit wchar allocation issue

2011-11-15 Thread Nicholas Marriott
Hi libedit miscalculates the amount of space needed for constructing it's wchar_t version of argv, causing it to overrun the buffer. I don't see how the output of mbstowcs can be longer than (sum(strlen(argv)) * sizeof (wchar_t)) so this fix should work: ok? Index: chartype.c =