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

Fix String.prototype.normalize() crash from #1683#1688
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
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