View Ticket
Not logged in
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]