Re: Infinite loop with CountDirective

Endre Stølsvik <[email protected]> Thu, 30 Mar 2006 13:22:07 +0200 (CEST)
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
On Wed, 29 Mar 2006, Keats Kirsch wrote:

| Thanks Sven.
| 
| I've gone through the code and found one other place where this loop could
| occur; the TypeDirective.  I have committed a patch for that as well.  There
| is currently no unit test for this directive; I'll try to add one.  (Does
| anybody use this?)
| 
| It occurs to me that we are still vulnerable to infinite loops with other
| Macro implementations.  I noticed in the PropertyMethod class that it actually
| tests if the Macro evaluates to itself.  This takes us one step further, but
| you could still have an infinite loop if there is a multiple class circular
| reference.  E.g., MacroA evals to MacroB which evals to MacroA.  It's probably
| not worth guarding against this somewhat arcane case.  What do folks think?

It is sad that WM gives this much power to the templating layer - on a 
philosophical level. I liked it when there wasn't even #count - you 
couldn't "program" i WM - as it was intentionally too limited for this - 
you were supposed to just lay out your already-fetched data.

Other stuff has been put into WM to guard against template-writers access 
to "dangerous classes and methods" (java.lang.Class), but now they can 
take the entire WM down by executing an infinite loop.

It doesn't matter for _me_, though.

Regards,
Endre.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642