Overview
| Artifact ID: | 3d3b82ea23eac71eef3124571018f181809f97b26cfc25e6b5c540548ef8d266 |
|---|---|
| Ticket: | 526b01c0b9921b90618f82c398dc2684a60a053a
lset with 2+ indices on an unshared lseq list is a use-after-free (crash) |
| User & Date: | apnadkarni on 2026-10-30 04:23:30 |
Changes
- closer changed to: "nobody"
- icomment:
Reopening as I **think** the fix is both incorrect and incomplete. In particular, the [lines](https://core.tcl-lang.org/tcl/file?ci=1b4052be16f50511&name=generic%2FtclListObj.c&ln=3219-3222) ``` /* It may be held only by a cache that is freed. [Bug 526b01c0b9] */ Tcl_IncrRefCount(subListObj); TclListObjSetElement(NULL, parentList, index, subListObj); Tcl_DecrRefCount(subListObj); ``` can land up calling TclListObjSetElement with a shared object which will cause a panic. Is there something that guarantees subListObj will only have a refcount of 0 before the IncrRefCount? However, an attempt to demonstrate is unexpected behavior: ``` % set l [lseq 5] 0 1 2 3 4 % set x X X % lset l 1 0 $x 0 X 2 3 4 % set m [lseq 5] 0 1 2 3 4 % lset m {2 0} $x -> crash ``` The fact that the above caused a crash and not a panic leaves me wondering if this is one bug or two. - login: "apnadkarni"
- mimetype: "text/x-markdown"
- resolution changed to: "Accepted"
- status changed to: "Open"