Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSStringGetUTF8CString writes beyond the provided buffer size #28674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robert-jenner
Copy link
Contributor

@robert-jenner robert-jenner commented May 16, 2024

44cd5f3

JSStringGetUTF8CString writes beyond the provided buffer size
rdar://122388595

Reviewed by Yusuke Suzuki.

U8_APPEND only checks the capacity in the non-ascii case,
so we should make sure we always check.

* Source/WTF/wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::convertLatin1ToUTF8):
(WTF::Unicode::convertUTF16ToUTF8):
* Source/WebCore/dom/TextEncoder.cpp:
(WebCore::TextEncoder::encodeInto):

Originally-landed-as: 272448.625@safari-7618-branch (800c12a28dea). rdar://128091153

44cd5f3

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style ❌ πŸ›  ios ❌ πŸ›  mac ❌ πŸ›  wpe ❌ πŸ›  wincairo
❌ πŸ›  ios-sim ❌ πŸ›  mac-AS-debug ❌ πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl ❌ πŸ§ͺ ios-wk2 ❌ πŸ§ͺ api-mac ❌ πŸ§ͺ api-wpe
❌ πŸ§ͺ ios-wk2-wpt ❌ πŸ§ͺ mac-wk1 ⏳ πŸ›  wpe-skia
❌ πŸ›  πŸ§ͺ jsc ❌ πŸ§ͺ api-ios ❌ πŸ§ͺ mac-wk2 ❌ πŸ›  gtk
❌ πŸ›  πŸ§ͺ jsc-arm64 ❌ πŸ›  tv ❌ πŸ§ͺ mac-AS-debug-wk2 ❌ πŸ§ͺ gtk-wk2
❌ πŸ›  tv-sim ❌ πŸ§ͺ mac-wk2-stress ❌ πŸ§ͺ api-gtk
❌ πŸ›  watch ❌ πŸ›  jsc-armv7
❌ πŸ›  watch-sim ❌ πŸ§ͺ jsc-armv7-tests

rdar://122388595

Reviewed by Yusuke Suzuki.

U8_APPEND only checks the capacity in the non-ascii case,
so we should make sure we always check.

* Source/WTF/wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::convertLatin1ToUTF8):
(WTF::Unicode::convertUTF16ToUTF8):
* Source/WebCore/dom/TextEncoder.cpp:
(WebCore::TextEncoder::encodeInto):

Originally-landed-as: 272448.625@safari-7618-branch (800c12a). rdar://128091153
@robert-jenner robert-jenner requested a review from a team as a code owner May 16, 2024 20:27
@robert-jenner robert-jenner self-assigned this May 16, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged
Projects
None yet
3 participants