Open AnthonyMikh opened 3 months ago
Hi thanks for reporting this. I don't exactly know what should be done though. I mean I could implement some checks:
I mean this could indeed be part of a backend and a user input could hang the server, but usually float is not used in ranges, indeed I wasn't even sure whether to implement it.
But yeah, if a backend accepts the user input as float, this could lead to a security issue, but I'm not sure about the best solution here.
What do you suggest?
Since floating point numbers have finite number of bits for mantissa, for very large numbers adding one does not change number:
Since you add ones in order to make up a range, if the range happens to contains such a number, the loop for collecting numbers can never stop. For example, the following code in theory runs indefinitely (in practice it hangs the computer):
Of course, the special values (negative and positive infinity, NaN) exhibit the same property. If start number of a range happens to be parsed as negative infinity, it also makes the loop run indefinitely: