Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fd27a24dd1c1c99d6c228ce9c25b74a914195282
https://github.com/WebKit/WebKit/commit/fd27a24dd1c1c99d6c228ce9c25b74a914195282
Author: Chris Dumez <[email protected]>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M Source/JavaScriptCore/API/JSScript.mm
M Source/JavaScriptCore/API/tests/testapi.mm
M Source/JavaScriptCore/corpse/tests/CorpseProcessTest.cpp
M Source/JavaScriptCore/jsc.cpp
M Source/JavaScriptCore/runtime/BytecodeCacheError.cpp
M Source/JavaScriptCore/tools/FunctionAllowlist.cpp
M Source/JavaScriptCore/tools/FunctionOverrides.cpp
M Source/WTF/wtf/SafeStrerror.cpp
M Source/WTF/wtf/SafeStrerror.h
M Source/WTF/wtf/cocoa/FileSystemCocoa.mm
M Source/WTF/wtf/glib/RunLoopGLib.cpp
M Source/WTF/wtf/playstation/OSAllocatorPlayStation.cpp
M Source/WTF/wtf/posix/FileSystemPOSIX.cpp
M Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
M Source/WTF/wtf/posix/ThreadingPOSIX.cpp
M Source/WTF/wtf/text/StringConcatenate.h
M Source/WTF/wtf/text/TextStream.cpp
M Source/WTF/wtf/text/TextStream.h
M Source/WebCore/platform/graphics/BitmapImageSource.cpp
M Source/WebCore/platform/graphics/BitmapImageSource.h
M Source/WebCore/platform/graphics/ImageFrameAnimator.cpp
M Source/WebCore/platform/graphics/ImageFrameAnimator.h
M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp
M Source/WebDriver/WebDriverService.cpp
M Source/WebDriver/WebSocketServer.h
M Source/WebDriver/soup/WebSocketServerSoup.cpp
M Source/WebKit/Platform/IPC/glib/ConnectionGLib.cpp
M Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
M Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
M Source/WebKit/UIProcess/API/gtk/WebKitPrintOperation.cpp
M Source/WebKit/UIProcess/Inspector/glib/RemoteInspectorClient.cpp
M Source/WebKit/UIProcess/Inspector/glib/RemoteInspectorClient.h
M Source/WebKit/UIProcess/XR/openxr/OpenXRGraphicsBindingOpenGLES.cpp
M Source/WebKit/UIProcess/glib/DisplayVBlankMonitorDRM.cpp
M Source/WebKit/WPEPlatform/wpe/drm/WPEViewDRM.cpp
M Tools/TestWebKitAPI/Tests/WTF/CString.cpp
M Tools/TestWebKitAPI/Tests/WTF/SafeStrerror.cpp
Log Message:
-----------
Delete StringTypeAdapter<CString> and make safeStrerror() return a UTF8CString
https://bugs.webkit.org/show_bug.cgi?id=324230
Reviewed by Yusuke Suzuki and Mike Wyrzykowski.
CString::span() returns span<const char>, which satisfies
HasAdaptableSpanMemberFunction, so
StringTypeAdapter<std::span<const char>> reinterprets the bytes as Latin-1.
makeString(),
StringBuilder::append() and TextStream therefore silently mojibaked any untyped
CString holding
non-ASCII UTF-8.
This closes that path the way PrintStream.h already closed printing: an
explicit specialization of
StringTypeAdapter with a deleted constructor, plus a deleted TextStream
overload. Specialization
matches the exact type, so CStringWithEncoding keeps using the span adapter
above it, where the
element type carries the encoding: char8_t decodes as UTF-8, Latin1Character
and char as Latin-1.
safeStrerror() is the live instance: two callers passed its span() to
makeString(). It now returns
a UTF8CString, which also fixes its length. It handed back the whole 1024-byte
newUninitialized()
buffer, so length() was always 1024 and span() exposed the uninitialized tail
past the message; the
result is now trimmed with strnlen(), which also covers strncpy() not
terminating on truncation.
Callers reached for data() only to print, so they pass the string itself: the
LOG and RELEASE_LOG
families convert it since 321137@main, and dataLog uses printInternal().
legacyCStringPointer()
remains only where a C vararg interface needs the pointer.
BitmapImageSource::sourceUTF8() and ImageFrameAnimator::sourceUTF8() were the
only fallout: both
returned an untyped CString that dump() streamed, while
BitmapImage::sourceUTF8() already returned
a UTF8CString. Typed to match.
* Source/JavaScriptCore/API/JSScript.mm:
(-[JSScript writeCache:]):
* Source/JavaScriptCore/API/tests/testapi.mm:
(resolvePathToScripts):
* Source/JavaScriptCore/corpse/tests/CorpseProcessTest.cpp:
(JSCToolsTest::reapedChildPid):
* Source/JavaScriptCore/jsc.cpp:
* Source/JavaScriptCore/runtime/BytecodeCacheError.cpp:
(JSC::BytecodeCacheError::StandardError::message const):
* Source/JavaScriptCore/tools/FunctionAllowlist.cpp:
(JSC::FunctionAllowlist::FunctionAllowlist):
* Source/JavaScriptCore/tools/FunctionOverrides.cpp:
(JSC::FunctionOverrides::parseOverridesInFile):
* Source/WTF/wtf/SafeStrerror.cpp:
(WTF::safeStrerror):
* Source/WTF/wtf/SafeStrerror.h:
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::darwinCacheDirectory):
(WTF::FileSystemImpl::darwinTempDirectory):
* Source/WTF/wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::runGLibMainLoopIteration):
(WTF::RunLoop::TimerBase::start):
* Source/WTF/wtf/playstation/OSAllocatorPlayStation.cpp:
(WTF::OSAllocator::protect):
* Source/WTF/wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::deleteFile):
* Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp:
(WTF::OSAllocator::protect):
* Source/WTF/wtf/posix/ThreadingPOSIX.cpp:
(WTF::logSchedulingAttributesFailure):
(WTF::Thread::establishHandle):
(WTF::Thread::updateSchedulingAttributes const):
* Source/WTF/wtf/text/StringConcatenate.h:
* Source/WTF/wtf/text/TextStream.cpp:
* Source/WTF/wtf/text/TextStream.h:
* Source/WebCore/platform/graphics/BitmapImageSource.cpp:
(WebCore::BitmapImageSource::sourceUTF8 const):
* Source/WebCore/platform/graphics/BitmapImageSource.h:
* Source/WebCore/platform/graphics/ImageFrameAnimator.cpp:
(WebCore::ImageFrameAnimator::sourceUTF8 const):
* Source/WebCore/platform/graphics/ImageFrameAnimator.h:
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp:
(WebCore::runCapabilityProbe):
(WebCore::MemoryMappedGPUBuffer::create):
* Source/WebKit/Platform/IPC/glib/ConnectionGLib.cpp:
(IPC::Connection::sendOutgoingHardwareBuffers):
(IPC::Connection::receiveIncomingHardwareBuffers):
* Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::sendOutgoingHardwareBuffers):
(IPC::Connection::receiveIncomingHardwareBuffers):
* Source/WebKit/UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationSendPagesToPrintPortal):
* Source/WebKit/UIProcess/XR/openxr/OpenXRGraphicsBindingOpenGLES.cpp:
(WebKit::OpenXRGraphicsBindingOpenGLES::exportOpenXRTextureAndroid):
* Source/WebKit/UIProcess/glib/DisplayVBlankMonitorDRM.cpp:
(WebKit::DisplayVBlankMonitorDRM::create):
* Source/WebKit/WPEPlatform/wpe/drm/WPEViewDRM.cpp:
(wpeViewDRMCommitAtomic):
(buildDamageBlob):
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringWithEncodingMakeString)):
* Tools/TestWebKitAPI/Tests/WTF/SafeStrerror.cpp:
(TestWebKitAPI::TEST(WTF_SafeStrerror, StringsAreEqual)):
(TestWebKitAPI::TEST(WTF_SafeStrerror, LengthMatchesMessage)):
Canonical link: https://commits.webkit.org/321212@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications