From 2f7186c04aa1ba81b151bc9a2043e50c3d3d6412 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 17 Sep 2004 08:47:38 +0000 Subject: Added a test on the bounds of the field index in command bbox. --- generic/tkZinc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'generic/tkZinc.c') diff --git a/generic/tkZinc.c b/generic/tkZinc.c index c9bb082..6465a31 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -4270,12 +4270,16 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */ result = ZnItemWithTagOrId(wi, args[0], &item, &search_var); if ((result == TCL_ERROR) || (item == ZN_NO_ITEM) || ! item->class->GetFieldSet) { - Tcl_AppendResult(interp, ", unknown item or doesn't support fields\" ", + Tcl_AppendResult(interp, "unknown item or doesn't support fields \"", Tcl_GetString(args[0]), "\"", NULL); goto error; } fs = item->class->GetFieldSet(item); if (field >= 0) { + if ((unsigned int) field >= fs->num_fields) { + Tcl_AppendResult(interp, "field index is out of bounds", NULL); + goto error; + } ZnFIELD.GetFieldBBox(fs, field, &bbox); } else { -- cgit v1.1