Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_ExternalToUtf - buffer overflow on output on invalid encoding

Closed / Fixed33f9b4de51219958c4fe65502c2a1c4ba84a9ffaCreated 2 years agoUpdated 2 years ago
Descriptionmarkdown2024-08-22 16:32:19

The following demonstrates overwrite of output buffer if high surrogate not followed by low surrogate at output buffer limit.

% set high [string range [encoding convertto utf-16le \U1f600] 0 1]
% set result [testencoding Tcl_ExternalToUtf utf-16le ${high}\xa8\x9e {start end noterminate tcl8} 0 5 nread nwrote]
Tcl_ExternalToUtf wrote past output buffer
Referenced by3
apnadkarniplain2024-08-22 16:34:21
Looking at it together with [f2e924e881], [945d2387d7]
apnadkarniplain2024-08-23 08:34:51
Fixed in [df6a7e1b38].
Log in (anonymous is fine) to add a comment.