From 411332610957226961be11bd79030e6af406a14a Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 7 Mar 2024 11:21:03 +0000 Subject: fixes segfault [a9625d1f53554f9d]: elemObj used uninitialized, lindex on lseq wo args must return whole list --- generic/tclListObj.c | 2 +- tests/lseq.test | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 94322f2..6c7f128 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -2637,7 +2637,7 @@ TclLindexFlat( if (TclHasInternalRep(listObj,&tclArithSeriesType)) { Tcl_Size listLen = TclArithSeriesObjLength(listObj); Tcl_Size index; - Tcl_Obj *elemObj = NULL; + Tcl_Obj *elemObj = listObj; /* for lindex without indices return list */ for (i=0 ; i