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

Ulf Lamping <[email protected]>
Newsgroups gmane.network.ethereal.devel
Message-ID <[email protected]>
Joe Hagen wrote:
> I believe the utf_8to16 function in epan/strutil.c
> has a bug.  I've experienced access violations
> with version 0.99.0 when starting a capture that
> point to this function.
>
> I performed tests using Windows XP SP2 and
> used the gflags program to enable page heap
> checking on ethereal.exe.
>
> The fault actually occurs in the Win32 function
> MultiByteToWideChar, but occurs because this
> code:
>
>   utf16buf[idx] = g_realloc(utf16buf[idx], utf16buf_len[idx]);
>
> doesn't account for the sizeof(wchar_t) when allocating
> memory, resulting in an access violation.  The buffer
> passed to MultiByteToWideChar is too small.
>
The code in the utf_8to16() function seems to be looking ok at first sight.

I would guess the problem is caused by an invalid utf8str string given 
to that function. Could you provide a call stack and an explanation what 
you've done to trigger that bug?

As this is obviously a bug, could you add a bug report to 
http://bugs.ethereal.com/bugzilla/ ?

Regards, ULFL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.