Tcl Source Code

View Ticket
Login
Ticket UUID: 66da4d4228be65fea83fa7eb4f9e932b7951341d
Title: Tcl_UtfToExternal buffer overwrite for non-BMP characters using utf-16 encoders
Type: Bug Created on: 2024-10-19 15:51:30
Submitter: apnadkarni Assigned to: nobody
Subsystem: 44. UTF-8 Strings Severity: Severe
Priority: 5 Medium Last modified: 2024-10-22 16:59:40
Status: Closed Closed by: apnadkarni
Resolution: Fixed Closed on: 2024-10-22 16:59:40
Version: 9.0.0
Description:

UTF-16 encoders write beyond destination space when encoding non-BMP characters.

% set utf8 [binary decode hex 41f09f988042]; encoding convertfrom utf-8 $utf8
A😀B
% testencoding Tcl_UtfToExternal utf-16le $utf8 {start end} {} 7 nread nwritten nchars
Tcl_UtfToExternal wrote past output buffer
User Comments:
apnadkarni added on 2024-10-19 16:21:29:
Proposed fix in [4574a1e8d3]