Ethereal-dev: Re: [Ethereal-dev] Ethereal 0.99.0 epan/strutil.c - utf_8to16 bug

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Thu, 27 Apr 2006 10:00:41 -0500
jdhagen@xxxxxxxxxx wrote:
> Ulf,
> 
> The string passed to the function is:
> 
> "C:\Program Files\Ethereal\dumpcap" -i \Device\NPF_{66E7710E-054E-408F-91A2-29B8AD1BDEDB} -Z -B 1 -f "ether host 00:14:22:CD:FD:42"
> 
> The string length exceeds INITIAL_FMTBUF_SIZE, so the
> g_realloc logic triggers.  However, the buffer is half
> the size it should be because it doesn't account for
> the size of wchar_t, resulting in the access violation.
> 
> Ironically, the call to g_malloc before this is correct:
> 
>    utf16buf[idx] = g_malloc(utf16buf_len[idx] * sizeof(wchar_t));
> 
> So the failure only occurs if the length of utf8str
> exceeds INITIAL_FMTBUF_SIZE.

Can you try build 18017 or later from
http://www.ethereal.com/distribution/buildbot-builds/win32/ and see if
the problem is fixed?