You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <ji...@apache.org> on 2005/09/19 00:58:55 UTC

[jira] Updated: (VELOCITY-297) Maximum recursion depth for macro calls

     [ http://issues.apache.org/jira/browse/VELOCITY-297?page=all ]

Will Glass-Husain updated VELOCITY-297:
---------------------------------------

    Bugzilla Id:   (was: 31563)
           type: Improvement  (was: Bug)
    Description: 
Similar to the option "directive.parse.maxdepth" I would love to see a parameter
to limit the depth of macro call recursion. In my scenario I let simple users
write macros to create html pages. Using recursive macros, they could get the
application to misbehave.

The following piece of code illustrates the problem:

#macro ( showInfo $p )
  Info: $p
  #showInfo($p)
#end
#showInfo("Test")

Which simply leads to:

java.lang.StackOverflowError
        at
org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:136)
        at
org.apache.velocity.runtime.directive.VMProxyArg.getObject(VMProxyArg.java:294)
        at org.apache.velocity.context.VMContext.get(VMContext.java:181)
   ....

Current workaround: Disable inline macros. Have responsible Script-Developers.

  was:
Similar to the option "directive.parse.maxdepth" I would love to see a parameter
to limit the depth of macro call recursion. In my scenario I let simple users
write macros to create html pages. Using recursive macros, they could get the
application to misbehave.

The following piece of code illustrates the problem:

#macro ( showInfo $p )
  Info: $p
  #showInfo($p)
#end
#showInfo("Test")

Which simply leads to:

java.lang.StackOverflowError
        at
org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:136)
        at
org.apache.velocity.runtime.directive.VMProxyArg.getObject(VMProxyArg.java:294)
        at org.apache.velocity.context.VMContext.get(VMContext.java:181)
   ....

Current workaround: Disable inline macros. Have responsible Script-Developers.

    Environment: 
Operating System: All
Platform: All

  was:
Operating System: All
Platform: All

      Assign To:     (was: Velocity-Dev List)
       Priority: Minor  (was: Major)

Seems like a good idea.  If you or someone else would like to contribute a patch, I'll commit it.

> Maximum recursion depth for macro calls
> ---------------------------------------
>
>          Key: VELOCITY-297
>          URL: http://issues.apache.org/jira/browse/VELOCITY-297
>      Project: Velocity
>         Type: Improvement
>   Components: Source
>     Versions: 1.4
>  Environment: Operating System: All
> Platform: All
>     Reporter: Jochen Toppe
>     Priority: Minor

>
> Similar to the option "directive.parse.maxdepth" I would love to see a parameter
> to limit the depth of macro call recursion. In my scenario I let simple users
> write macros to create html pages. Using recursive macros, they could get the
> application to misbehave.
> The following piece of code illustrates the problem:
> #macro ( showInfo $p )
>   Info: $p
>   #showInfo($p)
> #end
> #showInfo("Test")
> Which simply leads to:
> java.lang.StackOverflowError
>         at
> org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:136)
>         at
> org.apache.velocity.runtime.directive.VMProxyArg.getObject(VMProxyArg.java:294)
>         at org.apache.velocity.context.VMContext.get(VMContext.java:181)
>    ....
> Current workaround: Disable inline macros. Have responsible Script-Developers.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org