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.
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.
jinjava/src/main/java/com/hubspot/jinjava/lib/fn/Functions.java
Line 266 in fa2cb67