Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-02-05
21:11 • Closed ticket [2561794fff]: AppendUtfToUtfRep: overflow plus 8 other changes artifact: 5674ab08da user: dgp
21:11 • Ticket [2561794fff]: 4 changes artifact: 67d2767e75 user: dgp
20:35 • Ticket [2561794fff]: 4 changes artifact: 68d9961a9f user: dgp
02:59 • Ticket [2561794fff]: 4 changes artifact: b58c5c79f9 user: dgp
2009-02-04
02:49 • Ticket [2561794fff]: 4 changes artifact: 489ddbda9d user: dgp
2009-02-03
19:34 • New ticket [2561794fff]. artifact: 286b3388df user: dgp

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.