File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -712,10 +712,30 @@ protected function evaluateLogicalExpressionNode(
712712 }
713713
714714 if ($ astNode instanceof IntegerNode) {
715+ if ($ astNode ->token ->value > (string )PHP_INT_MAX || $ astNode ->token ->value < (string )PHP_INT_MIN ) {
716+ throw new JsonPathEvaluationException (
717+ 'Integer is out of range (possible range from ' . PHP_INT_MIN . ' to ' . PHP_INT_MAX . ') ' ,
718+ $ astNode ->token ->position ,
719+ $ evaluationContext ->expression ,
720+ 1702863910
721+ );
722+ }
723+
715724 return (int )$ astNode ->token ->value ;
716725 }
717726
718727 if ($ astNode instanceof FloatNode) {
728+ $ float = floatval ($ astNode ->token ->value );
729+
730+ if ($ float === INF || $ float === -INF ) {
731+ throw new JsonPathEvaluationException (
732+ 'Float is out of range (possible range from ' . PHP_FLOAT_MIN . ' to ' . PHP_FLOAT_MAX . ') ' ,
733+ $ astNode ->token ->position ,
734+ $ evaluationContext ->expression ,
735+ 1702863907
736+ );
737+ }
738+
719739 return (float )$ astNode ->token ->value ;
720740 }
721741
You can’t perform that action at this time.
0 commit comments