[jira] [Resolved] (JEXL-289) Passing undeclared function parameter can overwrite a local function variable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (JEXL-289) Passing undeclared function parameter can overwrite a local function variable

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/JEXL-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-289.
--------------------------------
    Resolution: Fixed
      Assignee: Henri Biestro

- When binding arguments, check the number of params as the upper limit of transferable ones; other args will be lost.

https://github.com/apache/commons-jexl/commit/817224be9c2762c8a79c1f392522cc98001e5be1

> Passing undeclared function parameter can overwrite a local function variable
> -----------------------------------------------------------------------------
>
>                 Key: JEXL-289
>                 URL: https://issues.apache.org/jira/browse/JEXL-289
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Major
>
> The following script
> {code:java}
> var x = function(a) { var b; return b}; x(1,2)
> {code}
> returns {{2}}. The expected behaviour is to return {{null}}.
> As an additional safeguarding measure we may also consider restricting a function call with more supplied arguments than the number of declared parameters, since, IMO, in a majority of cases this is a bug, like where the function definition was changed but the call was not updated accordingly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)