diff options
author | lecoanet | 2004-09-17 08:47:38 +0000 |
---|---|---|
committer | lecoanet | 2004-09-17 08:47:38 +0000 |
commit | 2f7186c04aa1ba81b151bc9a2043e50c3d3d6412 (patch) | |
tree | 4061b316b94061779c127688613dfb51d995e128 /generic | |
parent | 54b91cee6441e174be314e5b39574d94a7a795b8 (diff) | |
download | tkzinc-2f7186c04aa1ba81b151bc9a2043e50c3d3d6412.zip tkzinc-2f7186c04aa1ba81b151bc9a2043e50c3d3d6412.tar.gz tkzinc-2f7186c04aa1ba81b151bc9a2043e50c3d3d6412.tar.bz2 tkzinc-2f7186c04aa1ba81b151bc9a2043e50c3d3d6412.tar.xz |
Added a test on the bounds of the field index in command bbox.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkZinc.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 { |