Title: [236685] releases/WebKitGTK/webkit-2.22/Source/WebCore
Revision
236685
Author
[email protected]
Date
2018-10-01 12:45:24 -0700 (Mon, 01 Oct 2018)

Log Message

Merge r236666 - [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=190139

Patch by Olivier Blin <[email protected]> on 2018-10-01
Reviewed by Michael Catanzaro.

Like done upstream for EFL in r210213
https://bugs.webkit.org/show_bug.cgi?id=166622

This has been detected by a charactersAreAllASCII() assert failure.

This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
It is thus incorrect to use StringImpl::createFromLiteral() that calls
strlen() to get the string length.

The String::ConstructFromLiteral constructor can not be used, since it
skips the last character.

* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderThemeWPE::mediaControlsStyleSheet):
Explicitely pass the size to the String constructor.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (236684 => 236685)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-10-01 19:40:49 UTC (rev 236684)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-10-01 19:45:24 UTC (rev 236685)
@@ -1,3 +1,27 @@
+2018-10-01  Olivier Blin  <[email protected]>
+
+        [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
+        https://bugs.webkit.org/show_bug.cgi?id=190139
+
+        Reviewed by Michael Catanzaro.
+
+        Like done upstream for EFL in r210213
+        https://bugs.webkit.org/show_bug.cgi?id=166622
+
+        This has been detected by a charactersAreAllASCII() assert failure.
+
+        This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
+        mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
+        It is thus incorrect to use StringImpl::createFromLiteral() that calls
+        strlen() to get the string length.
+
+        The String::ConstructFromLiteral constructor can not be used, since it
+        skips the last character.
+
+        * platform/wpe/RenderThemeWPE.cpp:
+        (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
+        Explicitely pass the size to the String constructor.
+
 2018-09-27  Alicia Boya GarcĂ­a  <[email protected]>
 
         [MSE] Fix unwanted sample erase from the decode queue

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/wpe/RenderThemeWPE.cpp (236684 => 236685)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/wpe/RenderThemeWPE.cpp	2018-10-01 19:40:49 UTC (rev 236684)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/wpe/RenderThemeWPE.cpp	2018-10-01 19:45:24 UTC (rev 236685)
@@ -52,7 +52,7 @@
 #if ENABLE(VIDEO)
 String RenderThemeWPE::mediaControlsStyleSheet()
 {
-    return ASCIILiteral::fromLiteralUnsafe(mediaControlsBaseUserAgentStyleSheet);
+    return String(mediaControlsBaseUserAgentStyleSheet, sizeof(mediaControlsBaseUserAgentStyleSheet));
 }
 
 String RenderThemeWPE::mediaControlsScript()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to