Skip to content
Tcl Source Code History Of Ticket 183a1adcc0
Login

History Of Ticket 183a1adcc0

Artifacts Associated With Ticket 183a1adcc0

  1. Ticket change [debaa2f082] (rid 210082) by apnadkarni on 2023-03-12 17:05:18:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. 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.
      
    5. foundin initialized to: "8.6"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "11. Conversions from String"
    15. title initialized to: "Buffer overflow in Tcl_UtfToExternal"
    16. type initialized to: "Bug"
  2. Ticket change [f350212ca3] (rid 210086) by apnadkarni on 2023-03-12 17:33:15:

    1. assignee changed to: "apnadkarni"
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [3b495b1ef2] (rid 210110) by apnadkarni on 2023-03-13 16:10:11:

    1. icomment:
      Fixed in [4785751542] for 8.6. Merged to 8.7 and 9.0
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  4. Ticket change [58120f69c3] (rid 210111) by apnadkarni on 2023-03-13 16:10:28:

    1. closedate changed to: "2460017.1739456"
    2. closer changed to: "apnadkarni"
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"