[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:43:56 PST 2015


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

--- Comment #7 from Namhoon Kim <nakim at ea.com> ---
> Looking over this file, it seems like our 'snprintf' (a few lines above) suffers from the exact same problem. Could you please make the same correction there? Then we can land the patch in one go.

I fixed it too. Correcting handled before va_end calling. See below hunk please.

 inline int snprintf(char* buffer, size_t count, const char* format, ...) 
 {
     int result;
     va_list args;
     va_start(args, format);
     result = _vsnprintf(buffer, count, format, args);
+    if (result < 0 && errno != EINVAL)
+        result = _vscprintf(format, args);
     va_end(args);

-- 
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/65bcd9a2/attachment-0002.html>


More information about the webkit-unassigned mailing list