Skip to content

Fix String.prototype.normalize() crash from #1683 - #1688

Merged
saghul merged 1 commit into
quickjs-ng:masterfrom
sr5434:unicode_normalize_crash
Aug 24, 2026
Merged

saghul merged 1 commit into
quickjs-ng:masterfrom
sr5434:unicode_normalize_crash

Conversation

@sr5434

@sr5434 sr5434 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Return an empty string early in the String.prototype.normalize() method when the string is empty. This prevents an error caused by the first argument of memcpy being a null pointer, as reported in #1683. I added a test to verify that this is fixed.

When I was testing, I could not reproduce the issue on my Mac. However, I successfully reproduced it on a Docker container running ubuntu:24.04.

@sr5434
sr5434 marked this pull request as ready for review August 23, 2026 23:42
@sr5434 sr5434 changed the title Fix String.prototype.normalize() crash Fix String.prototype.normalize() crash from #1683 Aug 24, 2026
@saghul
saghul merged commit 2c620e4 into quickjs-ng:master Aug 24, 2026
128 checks passed
@sr5434
sr5434 deleted the unicode_normalize_crash branch August 24, 2026 11:05
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
quickjs-ng 0.17.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* update projects.md to include scriptc project reference (from the Ver… by @lukasMega in quickjs-ng/quickjs#1677
* Fixes segfault from #1661 by @sr5434 in quickjs-ng/quickjs#1675
* docs: add Qbs to projects by @ABBAPOH in quickjs-ng/quickjs#1685
* Add Big Endian architecture support instructions by @saghul in quickjs-ng/quickjs#1681
* Conditional BUILD_DIR by @kapouer in quickjs-ng/quickjs#1686
* Fix String.prototype.normalize() crash from #1683 by @sr5434 in quickjs-ng/quickjs#1688
* Fix reference count bug in Promise.withResolvers by @bnoordhuis in quickjs-ng/quickjs#1692
* Enable test262 host-gc-required feature by @bnoordhuis in quickjs-ng/quickjs#1696
* docs: add Vayu to projects by @athrvk in quickjs-ng/quickjs#1702
* Use mirror for Alpine GHA by @bnoordhuis in quickjs-ng/quickjs#1705
* Fix Iterator.from GetIteratorDirect handling by @jiang1997 in quickjs-ng/quickjs#1706
* Link against libm unconditionally on Unices by @bnoordhuis in quickjs-ng/quickjs#1699
* Fix out-of-bound read in JS_NewTypedArray by @bnoordhuis in quickjs-ng/quickjs#1704
* Preserve old interrupt handler in std.evalScript by @bnoordhuis in quickjs-ng/quickjs#1707
* fix: correct int/int32_t pointer mismatches for -Wincompatible-pointer-types by @SomSamantray in quickjs-ng/quickjs#1657
* Fix JS_FreeCStringUTF16 on slice strings by @bnoordhuis in quickjs-ng/quickjs#1709
* Add react-native-quickjs project to documentation by @saghul in quickjs-ng/quickjs#1710
* Move JSClass out of quickjs.h by @bnoordhuis in quickjs-ng/quickjs#1713
* Optimize JS_DeleteGlobalVar by @bnoordhuis in quickjs-ng/quickjs#1714
* Throw error when converting BigIntArray to Int8Array (#1690) by @sr5434 in quickjs-ng/quickjs#1694
* Fix power-of-two integer hash collisions by @bnoordhuis in quickjs-ng/quickjs#1720
* Store constant atoms more compactly in wire format by @bnoordhuis in quickjs-ng/quickjs#1719
* Prevent Object.preventExtensions when a TypedArray has a resizable ArrayBuffer by @sr5434 in quickjs-ng/quickjs#1695
* Make DOMException a bit more conformant by @goffrie in quickjs-ng/quickjs#1721
* Fix TypedArray.prototype.at() to handle resized ArrayBuffer correctly by @sr5434 in quickjs-ng/quickjs#1718
* Fix JS_SetMemoryLimit byte accounting on WASI by @josefguenther in quickjs-ng/quickjs#1711
* Fix(wasi): enable configurable stack overflow protection by @aayush-kapoor in quickjs-ng/quickjs#1700
* Use a bigger initial atom hash table by @bnoordhuis in quickjs-ng/quickjs#1723
* Add private symbols by @bnoordhuis in quickjs-ng/quickjs#1725
* Peephole-optimize negation + conditional jump by @bnoordhuis in quickjs-ng/quickjs#1726
* Check for property deletion when accessing in `with` by @sr5434 in quickjs-ng/quickjs#1722

## New Contributors
* @lukasMega made their first contribution in quickjs-ng/quickjs#1677
* @kapouer made their first contribution in quickjs-ng/quickjs#1686
* @athrvk made their first contribution in quickjs-ng/quickjs#1702
* @SomSamantray made their first contribution in quickjs-ng/quickjs#1657
* @goffrie made their first contribution in quickjs-ng/quickjs#1721
* @josefguenther made their first contribution in quickjs-ng/quickjs#1711
* @aayush-kapoor made their first contribution in quickjs-ng/quickjs#1700

**Full Changelog**: https://github.com/quickjs-ng/quickjs/compare/v0.16.2...v0.17.0</pre>
  <p>View the full release notes at <a href="https://github.com/quickjs-ng/quickjs/releases/tag/v0.17.0">https://github.com/quickjs-ng/quickjs/releases/tag/v0.17.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!20596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants