[Webkit-unassigned] [Bug 140917] Windows return -1 when calling vsnprintf with arguments that exceed target buffer size

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 27 18:39:02 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=140917

--- Comment #6 from Namhoon Kim <nakim at ea.com> ---
> Thank you for tracking this down. Do we have any other cases where a similar mistake is being made?

MSVC version of vprintf_stderr_common (in Assertions.cpp) has similar (or worse) problem. If result debug formatted string length is exactly 1024 bytes, there is no null character placed in the buffer. It results following OutputDebugStringA call prints some garbage bytes also.

I think we simply fix it by calling vsnprintf (which is polyfilled by wtf_vsnprintf when using windows) instead of _vsnprintf.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150128/b4a9909e/attachment-0002.html>


More information about the webkit-unassigned mailing list