[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:09:57 PST 2015


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

Brent Fulgham <bfulgham at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #245424|review?                     |review+, commit-queue+
              Flags|                            |

--- Comment #3 from Brent Fulgham <bfulgham at webkit.org> ---
Comment on attachment 245424
  --> https://bugs.webkit.org/attachment.cgi?id=245424
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=245424&action=review

Thank you for noticing this! I had to do some reading just now to understand your change.

> Source/WTF/wtf/StringExtras.h:65
> +        result = _vscprintf(format, args);

I see; MSVC returns negative in the case of a 'buffer overrun converted to a truncation', while POSIX systems return the count as if nothing bad happened.

Very nice fix!

-- 
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/565836c4/attachment-0002.html>


More information about the webkit-unassigned mailing list