Skip to content
Tcl Source Code View Ticket
Login

View Ticket

UpdateStringOfList(): signed integer overflow

Closed / Fixed5ec43cfd9bf974320c70faa342a017e4b7e70abbCreated 4 years agoUpdated 4 years ago
Descriptionwiki2022-10-04 06:14:57
…which this example script triggers and the attached patch prevents:
# s has string representation with length INT_MAX-1
set s [string repeat [string repeat {a} 14949] 143654]
set l [list aa $s]
puts [string is upper $l]
tcl/generic/tclListObj.c:1988:14: runtime error: signed integer overflow: 2 + 2147483646 cannot be represented in type 'int'
max size for a Tcl value (2147483647 bytes) exceeded
(tclsh aborts)
Referenced by1
jan.nijtmanswiki2022-10-06 10:23:53

Should be fixed [here]

Log in (anonymous is fine) to add a comment.

Attachments: