Skip to content
Tcl Source Code View Ticket
Login

View Ticket

AppendUtfToUtfRep: overflow

Closed / Fixed2561794fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-02-03 19:34:41
Other bugs are interfering with
construction of a demo case, but...

    oldLength = objPtr->length;
    newLength = numBytes + oldLength;

There's nothing there to check whether
the sum to produce the newLength has
overflowed the (signed int) limits we
have on string lengths.
dgpplain2009-02-04 02:49:32
This might be it:

% info patch
8.5.6
% set a [string repeat a 0x7ffffffe]; concat
% string length $a
2147483646
% append a a; concat
% append a a; concat
Segmentation fault
dgpplain2009-02-05 02:59:45
fixed in HEAD.
dgpplain2009-02-05 20:35:04
elated:

% set a [string repeat a 0x3fffffff]; concat
% append a $a; concat
Segmentation fault

already fixed on HEAD; also need backport
dgpplain2009-02-05 21:11:21
backported for 8.5.7 and 8.4.20
dgpplain2009-02-05 21:11:26
allow_comments - 1
Log in (anonymous is fine) to add a comment.