[webkit-changes] [WebKit/WebKit] 6d24e0: [JSC] Avoid using snprintf in DatePrototype.cpp

Yusuke Suzuki noreply at github.com
Fri Mar 22 19:58:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d24e0d96b9e1ba2a9f9d0fee0a6f76fd78f0be5
      https://github.com/WebKit/WebKit/commit/6d24e0d96b9e1ba2a9f9d0fee0a6f76fd78f0be5
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2024-03-22 (Fri, 22 Mar 2024)

  Changed paths:
    M Source/JavaScriptCore/runtime/DatePrototype.cpp

  Log Message:
  -----------
  [JSC] Avoid using snprintf in DatePrototype.cpp
https://bugs.webkit.org/show_bug.cgi?id=271490
rdar://125258271

Reviewed by Justin Michaud and Keith Miller.

Clang is wrongly computing snprintf's potential size (https://github.com/llvm/llvm-project/issues/71320), and generating wrong error.
But given that we already have efficient WTF String's mechanism, we should just use it instead of snprintf, slow and buggy.
This patch converts DatePrototype.cpp's snprintf usage to our own makeString.

* Source/JavaScriptCore/runtime/DatePrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

Canonical link: https://commits.webkit.org/276582@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list