Tcl Source Code

View Ticket
Login
Ticket UUID: 5ec43cfd9bf974320c70faa342a017e4b7e70abb
Title: UpdateStringOfList(): signed integer overflow
Type: Patch Version: core-8-6-branch
Submitter: chrstphrchvz Created on: 2022-10-04 06:14:57
Subsystem: 14. List Object Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2022-10-06 10:23:53
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2022-10-06 10:23:53
Description:

…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)

User Comments: jan.nijtmans added on 2022-10-06 10:23:53:

Should be fixed [0e2b23ff845b1e1b|here]


Attachments: