Overview
| Artifact ID: | f305bc01ecadf8edc789a75b9b6e1e8389bf2a67224d4afd0a37242eb6942c87 |
|---|---|
| Ticket: | 28de50dcee4f6888eaed987bf1d795ac67138b5f
Crash on invalid Unicode code points |
| User & Date: | jan.nijtmans on 2026-11-25 14:17:44 |
Changes
- assignee changed to: "apnadkarni"
- closedate changed to: "2461370.0956584606"
- closer changed to: "jan.nijtmans"
- icomment:
Thanks for fixing this! I agree with this solution, and merged it to core-9-0-branch and core-8-6-branch too. >... TCL_COMBINE ... As far as I can tell, there is no need in Tcl 9 for this flag The flag TCL_COMBINE is useful if you want to build a UTF-16 decoder using Tcl_UniCharToUtf(). The alternative is a new Tcl_Char16ToUtf(), which shares a lot of code with Tcl_UniCharToUtf(). It didn't seem worth it at the time. Note that this cannot be triggered at pure script-level, only when feeding Tcl_NewUnicodeObj() with invalid UTF-32 data. What could be done additionally is add a check to ExtendStringRepWithUnicode, line 4674, like: <pre> dst += Tcl_UniCharToUtf(((unsigned)unicode[i] < 0x110000) ? unicode[i] : 0xFFFD, dst); </pre> That would also have prevented this crash.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"