From 37c98dfca2ad501d2fbcb8e49ea6f3a4770c3843 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Sat, 1 Feb 2025 18:55:52 -0800 Subject: [PATCH] electron33: update to 33.2.0. --- .../patches/spellchecker-infinate-loop.patch | 31 +++++++++++++++++++ srcpkgs/electron33/template | 8 ++--- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/electron33/patches/spellchecker-infinate-loop.patch diff --git a/srcpkgs/electron33/patches/spellchecker-infinate-loop.patch b/srcpkgs/electron33/patches/spellchecker-infinate-loop.patch new file mode 100644 index 00000000000000..df73d1349269f7 --- /dev/null +++ b/srcpkgs/electron33/patches/spellchecker-infinate-loop.patch @@ -0,0 +1,31 @@ +From 9f6ee267adabcbd3348dd1a4daf57843aef14050 Mon Sep 17 00:00:00 2001 +From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> +Date: Fri, 13 Dec 2024 16:47:55 +0000 +Subject: [PATCH] fix: custom spell-checker stuck in infinite loop + +`ReadUnicodeCharacter` updates index to the last character read, and not after it. We need to manually increment it to move to the next character. + +It also doesn't validate that the index is valid, so we need to check that index is within bounds. + +Refs: #44336 + +Co-authored-by: Jesper Ek +--- + shell/renderer/api/electron_api_spell_check_client.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc +index b97f1771ff723..95e05ecccb524 100644 +--- a/src/electron/shell/renderer/api/electron_api_spell_check_client.cc ++++ b/src/electron/shell/renderer/api/electron_api_spell_check_client.cc +@@ -32,7 +32,9 @@ namespace { + + bool HasWordCharacters(const std::u16string& text, size_t index) { + base_icu::UChar32 code; +- while (base::ReadUnicodeCharacter(text.c_str(), text.size(), &index, &code)) { ++ while (index < text.size() && ++ base::ReadUnicodeCharacter(text.c_str(), text.size(), &index, &code)) { ++ ++index; + UErrorCode error = U_ZERO_ERROR; + if (uscript_getScript(code, &error) != USCRIPT_COMMON) + return true; diff --git a/srcpkgs/electron33/template b/srcpkgs/electron33/template index 1b08bbe8ecaf51..cffabd57a7c621 100644 --- a/srcpkgs/electron33/template +++ b/srcpkgs/electron33/template @@ -1,9 +1,9 @@ # Template file for 'electron33' pkgname=electron33 -version=33.0.2 +version=33.2.0 revision=1 _nodever=20.18.0 -_chromiumver=130.0.6723.59 +_chromiumver=130.0.6723.118 archs="x86_64* aarch64*" create_wrksrc=yes build_wrksrc="src" @@ -27,8 +27,8 @@ homepage="https://electronjs.org" distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz" -checksum="c6d3be16998ee1f92020078e39dd5c7ea98a1222d2f68919b533ef7f507521fa - 90401be8adcd6f580db5c71ea865c97db0e719ba41f406f5869fc7f44bd20e4f +checksum="6a0589bbdbf1d5ccc8508b536c1beeb5f49cedb1806dc0de9b04f568946be056 + a0a9a740ebb864e89febf4d5480ffbf31b45ac5a506ae70184fa842e27b2d177 651bb82f6af18084070893559643759165ce050b5839f830d4cc098130d3ad89"