Repository navigation
Build OpenCC 1.4.2 for the out-of-bounds read fixes (GHSA-7fqq-q52p-2jjg) - #250
Conversation
OpenCC 1.1.9, the librime 1.17.0 submodule, has two out-of-bounds reads on malformed UTF-8 (GHSA-7fqq-q52p-2jjg), fixed in 1.2.0. Pin ver.1.4.2, the version librime master uses, and move the vendored s2t text dictionaries to the same revision. OpenCC 1.4.2 already builds as C++17, so the language-standard patch goes. Its CMake derives the version from `git describe`, which would read this repository's tags; hide Git from that configure step. Fixes #211 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b82b3ee56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "url": "https://codeload.github.com/BYVoid/OpenCC/tar.gz/025f371dc76b598d77384fbdab90c937471844d8", | ||
| "sha256": "8b27931630abab1136b7c3ee920e4a95e78cb84a3cab4670198172bc82104844", |
There was a problem hiding this comment.
Refresh the cached OpenCC archive when changing its pin
When build/portable contains the previous build, this pin change causes build-native.py to abort with Checksum mismatch: .../opencc.tar.gz: its download loop (lines 39–45) reuses an existing archive by filename without refreshing it when the locked checksum changes. This affects existing developer checkouts and CI: both .github/workflows/ci.yml and .github/workflows/macos.yml specify prefix restore-keys that can restore the old native cache despite the new exact cache key. Update archive-cache invalidation alongside this bump, for example by including the source digest in archive filenames, while retaining checksum verification of newly downloaded archives.
Useful? React with 👍 / 👎.
CI restores build/portable from the newest cache when the lock changes. The archive of the previous pin was then kept and failed the checksum, so a dependency bump could not build. Download the archive again when its digest differs from the lock, and drop that dependency's CMake build directory when its source is replaced. Refs #211 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
CI failed with |
Extracted headers keep their archive dates, so Ninja did not recompile librime against the new OpenCC headers in a restored CI cache and the link failed. Remove the install prefix and every CMake build directory when a source is replaced. The explanation moves to the README, where the comment lint wants it. Refs #211 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Summary
Fixes #211
Builds OpenCC
ver.1.4.2(025f371dc76b598d77384fbdab90c937471844d8) instead of 1.1.9, for the two out-of-boundsreads of GHSA-7fqq-q52p-2jjg (fixed in 1.2.0). The issue left "bump now or wait for librime" open; this bumps now:
librime 1.17.0 compiles and passes against 1.4.2 unchanged, and librime
masteralready uses it.native-sources.lock.json: new OpenCC revision and archive SHA-256.build-native.py: the C++14 → C++17 patch is gone (1.4.2 is C++17). OpenCC's CMake now derives its version fromgit describe, which reads this repository's tags, so Git is hidden from that configure step(
opencc.pcreports1.4.2).schemas/opencc/STPhrases.txt,STCharacters.txt: unmodified 1.4.2 data. The files now start with#commentheaders, which 1.4.2 parses.
macOS/DEPENDENCIES.md,Core/Portable/README.md,licenses.md, the source-bundle record and the Linux sourcenotice name the new version and hashes.
opencc/LICENSEis byte-identical, somacOS/Licenses/opencc.txtstays.Acceptance
librime.1.dyliblinks OpenCC ≥ 1.2.0: OpenCC is linked statically into the dylib; the build prefixholds
opencc.pcVersion: 1.4.2andnative-build.jsonrecords revision025f371d….bash macOS/scripts/test.sh portable engine source-bundle:PASS 7 units(engine-basic, engine-options,engine-english, engine-context, engine-custom-phrases, source-bundle, portable), including the traditional
(
hulianwang→互聯網) and Emoji checks. Conversion review of the data, 1.1.9 → 1.4.2:STPhrases.txt: 840 phrases added, 698 removed, 279 changed (263 with a different first value). The changesare upstream corrections, e.g.
万里春愁直萬裏…→萬里…,三复三複→三復,云溪云溪→雲溪.STCharacters.txt: 32 characters added, none removed, 13 gain variants; the first value changes for two(
托託→托,硷礆→硷).Traditional output is off by default, so default candidates are unaffected.
PASS portable notices match the pinned sources and Cargo.lock.Also run:
bash macOS/scripts/build.sh(passes), andbash Core/Portable/performance.shbecause Emoji conversionruns through OpenCC on the key path: all limits ok (repeated-pass key p95 0.765 ms / limit 1.8, p99 0.908 / 2.3,
first-pass p99 1.143 / 2.6, max first key 7.907 / 25, startup median 117 ms, peak RSS 56 MiB).
Deviations and open issues
-include cstdintkept) is covered by CI.Delivery record
🤖 Generated with Claude Code