summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-02-01 20:29:11 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-02-01 20:29:11 (GMT)
commit71d3ecf5286248746cff74281e25ad7705f2cb31 (patch)
treed506b488fac01114b805ea179c6a8290cae98a2f /generic/ttk
parent93df2a8bdb1df5f570a9d7208c288212adbe7834 (diff)
downloadtk-71d3ecf5286248746cff74281e25ad7705f2cb31.zip
tk-71d3ecf5286248746cff74281e25ad7705f2cb31.tar.gz
tk-71d3ecf5286248746cff74281e25ad7705f2cb31.tar.bz2
Fix [3fefb364e2]: crash in ttk::combobox current. Test combobox-2.8 now passes.
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkEntry.c12
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.