Overview
| Artifact ID: | f9014720a7de8f2f51d0f08a0d40bec3d8319654 |
|---|---|
| Ticket: | 694232ffffffffffffffffffffffffffffffffff
lsearch causes segmentation fault |
| User & Date: | uring on 2003-02-27 08:23:43 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
The command lsearch -start 0 {} x causes a segmentation fault. This happens in function Tcl_LsearchObjCmd(). The given argument "-start 0" in combination with an empty list causes the variable "offset" to become -1. From snapshot 2003-02-25: 2931 if (offset < 0) { 2932 offset = 0; 2933 } else if (offset > listc-1) { 2934 offset = listc-1; 2935 } I'd prefer to have line 2934 as follows: 2934 offset = listc > 0 ? listc-1 : 0; Perhaps this is also worth a test in lsearch.test, for example: test lsearch-xx.x {combine -start 0 with empty list} { lsearch -start 0 {} x } -1 - foundin changed to: "obsolete: 8.4.1.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "uring"
- subsystem changed to: "17. Commands I-L"
- title changed to: "lsearch causes segmentation fault"
- type changed to: "Bug"