* Limit maximal loop count for Macro.resolveHandler() lookup.

Fixes symptoms of bug 543.
  <http://helma.org/bugs/show_bug.cgi?id=543>
This commit is contained in:
hns 2007-11-12 14:43:48 +00:00
parent 5cd2021502
commit 54617d09c1

View file

@ -1099,8 +1099,10 @@ public final class Skin {
// the handler object is not what we want
Object obj = thisObject;
// walk down parent chain to find handler object
while (obj != null) {
// walk down parent chain to find handler object,
// limiting to 50 passes to avoid infinite loops
int maxloop = 50;
while (obj != null && maxloop-- > 0) {
Prototype proto = app.getPrototype(obj);
if ((proto != null) && proto.isInstanceOf(handlerName)) {