[webkit-changes] [WebKit/WebKit] b88688: Cherry-pick 284396 at main (8b5404a28cd2). https://bu...

Adrian Perez noreply at github.com
Sun Sep 29 04:12:31 PDT 2024


  Branch: refs/heads/webkitglib/2.46
  Home:   https://github.com/WebKit/WebKit
  Commit: b88688d485e6f812e3b8ccedbb06ccc061dca45d
      https://github.com/WebKit/WebKit/commit/b88688d485e6f812e3b8ccedbb06ccc061dca45d
  Author: David Kilzer <ddkilzer at apple.com>
  Date:   2024-09-28 (Sat, 28 Sep 2024)

  Changed paths:
    M Source/WTF/wtf/Compiler.h
    M Source/WTF/wtf/HexNumber.h
    M Source/WebCore/platform/network/FormDataBuilder.cpp

  Log Message:
  -----------
  Cherry-pick 284396 at main (8b5404a28cd2). https://bugs.webkit.org/show_bug.cgi?id=280496

    [WTF] HexNumberBuffer::span() should not ignore std::array size
    <https://bugs.webkit.org/show_bug.cgi?id=280496>
    <rdar://136802343>

    Reviewed by Geoffrey Garen.

    Fix construction of HexNumberBuffer::span() to convert std::array first,
    then create a subspan from the last N characters.

    Remove unsafe characters() methods and use span() instead.

    Introduce LIFETIME_BOUND attribute to prevent use-after-free bugs with
    C++ temporary objects.  (I accidentally introduced this bug in a local
    version of this change before posting it.)

    * Source/WTF/wtf/Compiler.h:
    (LIFETIME_BOUND): Add.
    - Add support for the lifetimebound attribute in clang and gcc.

    * Source/WTF/wtf/HexNumber.h:
    (WTF::HexNumberBuffer::characters const): Delete.
    - Remove unsafe method.
    (WTF::HexNumberBuffer::span const):
    - Adopt LIFETIME_BOUND attribute for this method.
    - Change to construct std::span directly from std::array, then use
      std::span::last() to create a span of the last N elements.
    (WTF::StringTypeAdapter<HexNumberBuffer>::characters const): Delete.
    - Remove unused method.

    * Source/WebCore/platform/network/FormDataBuilder.cpp:
    (WebCore::FormDataBuilder::appendFormURLEncoded):
    - Switch to use HexNumberBuffer::span(), but keep hexBuffer alive on the
      stack.

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

Canonical link: https://commits.webkit.org/282416.176@webkitglib/2.46



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