Wininet Buffer Length Fixes

Alexandre Julliard julliard at winehq.org
Tue Jul 13 16:42:13 CDT 2004


Robert Shearman <rob at codeweavers.com> writes:

> In the case of a string, the byte count does not include the string's
> terminating null character.
>
> Since WideCharToMultiByte returns the number of bytes written
> including the null terminator it is required to take one away from it,
> although the misleading *sizeof(CHAR) can be removed.

I meant the line above, where you use *lpdwBufferLength+1, this will
overflow the buffer. Note that since len doesn't include the
terminating NULL, converting len/sizeof(WCHAR) characters won't get
you a terminating NULL even with a larger dest buffer.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list