Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ad622ae6c2ebbcc1f06d96fddb2d13565f4d6bab
      
https://github.com/WebKit/WebKit/commit/ad622ae6c2ebbcc1f06d96fddb2d13565f4d6bab
  Author: Chris Dumez <[email protected]>
  Date:   2024-04-08 (Mon, 08 Apr 2024)

  Changed paths:
    M Source/WebCore/css/make-css-file-arrays.pl
    M Source/WebCore/style/UserAgentStyle.cpp
    M Source/WebKit/NetworkProcess/soup/WebKitDirectoryInputStream.cpp

  Log Message:
  -----------
  Regression(277164@main) Crash under UserAgentStyle::initDefaultStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=272363

Reviewed by Sihui Liu.

In 277164@main, I made an minor optimization attempt in 
UserAgentStyle::initDefaultStyleSheet(),
to try to avoid constructing a StringImpl of the stylesheet when we end up 
calling makeString()
to concatenate later on.

This caused a crash because the stylesheets are of `const char[]` type and are 
NOT null
terminated. My intention was to construct a std::span from those arrays but I 
failed to do it
explicitly and it didn't happen implicitly.

To make this less error-prone, I am now using std::array<const char> for these 
stylesheets,
to avoid the implicit conversion to `const char*`, which is too error-prone 
given the lack of
null terminator.

* Source/WebCore/css/make-css-file-arrays.pl:
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::initDefaultStyleSheet):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to