From: Jeff Hobbs <jeffh@ac...> - 2006-11-24 17:24:50
I just went through a correct solution for:
and found that we weren't doing bounds checking with menu underlines. =
important to note that Tcl_UtfAtIndex does *not* do any bounds checking. =
will gleefully run off the end of the valid string range. Callers =
sure to do correct bounding on the index that they pass in.
A quick grep reveals that its used in several places in Tk (and like the =
bug, probably needed in several places more). I see already that =
has the same unbounded index bug.
This is just a reminder to watch how you make use of that API
(Tcl_UniCharAtIndex is the same, as are a few other Tcl_Utf* helper =
that expect you to know your bounds).
Jeff Hobbs, The Tcl Guy, http://www.ActiveState.com/