Skip to content

Range function uses end=0 instead of end=RANGE_LIMIT when end exceeds max int #263

Description

@MosheElisha

Hi,

When using a number (e.g., 9999999999) that exceeds Integer.MAX_VALUE (2147483647) - the range function uses an "end" of 0.

Unlike invalid number inputs (e.g. "abc") I believe that in this case, the "end" should be set to RANGE_LIMIT as the value is a valid number (although not a valid int).

To reproduce:

{% for counter in range(1, 9999999999) %}

The issue is caused because the code uses NumberUtils.toInt(...) which return 0 if the int conversion failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions