Artifacts Associated With Ticket 183a1adcc07cddc6
Ticket change [debaa2f082] (rid 210082) by apnadkarni on 2023-03-12 17:05:18:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
When passed a one byte buffer, Tcl_UtfToExternal writes the null terminator beyond the buffer. In the TIP-656 branch, ``` % testencoding Tcl_UtfToExternal unicode A {start end} {} 1 Tcl_ExternalToUtf wrote past output buffer ``` The function is identical to the core-8-branch so the bug should appear [there](https://core.tcl-lang.org/tcl/file?ci=3a7e4c1c38532805&name=generic/tclEncoding.c&ln=1588-1592) as well. 8.6 has slightly different [code](https://core.tcl-lang.org/tcl/file?ci=0336bcea26d73927&name=generic/tclEncoding.c&ln=1418-1425) but has same issue. Basically, the encoding's nul length is subtracted from the passed destination buffer length without checking for a negative result. Subsequently the nul bytes (2 in this case) are written to the buffer. Although a single byte buffer might seem unlikely, the possibility exists in streaming operation where caller might repeatedly call the function using the same (updated) buffer until `TCL_CONVERT_NOSPACE` is returned and there happens to be just one free byte in the buffer. - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "apnadkarni"
- priority initialized to: "5 Medium"
- private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "11. Conversions from String"
- title initialized to: "Buffer overflow in Tcl_UtfToExternal"
- type initialized to: "Bug"
Ticket change [f350212ca3] (rid 210086) by apnadkarni on 2023-03-12 17:33:15:
- assignee changed to: "apnadkarni"
- login: "apnadkarni"
- mimetype: "text/plain"
Ticket change [3b495b1ef2] (rid 210110) by apnadkarni on 2023-03-13 16:10:11:
- icomment:
Fixed in [4785751542] for 8.6. Merged to 8.7 and 9.0
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [58120f69c3] (rid 210111) by apnadkarni on 2023-03-13 16:10:28:
- closedate changed to: "2460017.1739456"
- closer changed to: "apnadkarni"
- login: "apnadkarni"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"