Skip to content

Commit

Permalink
Fix potential vulnerability by replacing float with Decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
paul019 committed Mar 19, 2024
1 parent 398df1c commit 5525348
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/domain/value.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def set_min_exponent(self, min_exponent: int):
# Check if the value is too small to be rounded to the specified number of decimal
# places:
rounded = Helpers.round_to_n_decimal_places(self._value, -min_exponent)
if float(rounded) == 0 and self._value != 0:
if Decimal(rounded) == 0 and self._value != 0:
raise DecimalPlacesError()

def get_min_exponent(self) -> int:
Expand Down

0 comments on commit 5525348

Please sign in to comment.