diff options
author | fvogel <fvogelnew1@free.fr> | 2022-02-01 20:29:11 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2022-02-01 20:29:11 (GMT) |
commit | 71d3ecf5286248746cff74281e25ad7705f2cb31 (patch) | |
tree | d506b488fac01114b805ea179c6a8290cae98a2f | |
parent | 93df2a8bdb1df5f570a9d7208c288212adbe7834 (diff) | |
download | tk-71d3ecf5286248746cff74281e25ad7705f2cb31.zip tk-71d3ecf5286248746cff74281e25ad7705f2cb31.tar.gz tk-71d3ecf5286248746cff74281e25ad7705f2cb31.tar.bz2 |
Fix [3fefb364e2]: crash in ttk::combobox current. Test combobox-2.8 now passes.
-rw-r--r-- | generic/ttk/ttkEntry.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 1d8137b..1c2f477 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1849,10 +1849,20 @@ static int ComboboxCurrentCommand( switch (index) { case INDEX_END: /* "end" index */ + if (nValues <= 0) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "Index end out of range")); + Tcl_SetErrorCode(interp, "TTK", "COMBOBOX", "IDX_RANGE", NULL); + return TCL_ERROR; + } currentIndex = nValues - 1; break; + default: + Tcl_Panic("Unknown named index"); + return TCL_ERROR; } - } else { + + } else { /* * The index should be just an integer. |