|
2003-02-27
| ||
| 23:55 | • Ticket [694232ffff] lsearch causes segmentation fault status still Closed wi... artifact: 3612acc4d3 user: dgp | |
| 23:14 | • Closed ticket [694232ffff]. artifact: f635601dcb user: dkf | |
| 16:50 | • Ticket [694232ffff]: 1 change artifact: b9747c75b7 user: dkf | |
| 08:23 | • New ticket [694232ffff]. artifact: f9014720a7 user: uring | |
lsearch causes segmentation fault
Closed / Fixed694232ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-02-27 08:23:43
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
dkf Ticket [694232ffff]: 1 change
[History diff]2003-02-27 16:50:41
dkfplain2003-02-27 23:14:00
Logged In: YES user_id=79902 Fixed. (Why are these bugs always found during code-freeze?)
dgpplain2003-02-27 23:55:18
Logged In: YES user_id=80530 ...because more people actually test during code freeze?
Log in (anonymous is fine) to add a comment.