View Ticket
Not logged in
2023-04-24
16:29 Closed ticket [a814ee5bbd]: string equal,compare -length option fails for large indices plus 6 other changes artifact: 498de3b484 user: apnadkarni
16:28
Fix [a814ee5bbd] - string compare/equal -length for long strings check-in: e831429a4d user: apnadkarni tags: trunk, main
2023-04-04
08:24 Ticket [a814ee5bbd] string equal,compare -length option fails for large indices status still Open with 3 other changes artifact: 9e147f7c6c user: apnadkarni
05:40 New ticket [a814ee5bbd]. artifact: 864f431019 user: apnadkarni

Ticket UUID: a814ee5bbdb2bbd512397e69704870e14b861985
Title: string equal,compare -length option fails for large indices
Type: Bug Version:
Submitter: apnadkarni Created on: 2023-04-04 05:40:50
Subsystem: 18. Commands M-Z Assigned To: apnadkarni
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2023-04-24 16:29:03
Resolution: Fixed Closed By: apnadkarni
    Closed on: 2023-04-24 16:29:03
Description:
Multiple failure modes when a large length is specified for the `-length` option to `string equal|compare`.

```
% set s1 [string cat [string repeat a 0xfffffffe] X]; string length $s1
4294967295
% set s2 [string cat [string repeat a 0xfffffffe] Y]; string length $s2
4294967295
% string equal -length 0xffffffff $s1 $s2
0 -> correct
% string equal -length 0xfffffffe $s1 $s2
0 -> wrong, should be 1
```

For larger values of `-length` , a different error

```
% string equal -length 0x100000000 a b
integer value too large to represent
```
User Comments: apnadkarni added on 2023-04-24 16:29:03:
Fixed in [e831429a4d]