From: Kevin Day Date: Sun, 19 Jun 2022 00:22:56 +0000 (-0500) Subject: Security: Floating point exception due to incorrect number type used in conversion... X-Git-Tag: 0.5.10~32 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=fdfef157675f3a1c634014da22d0862d53e986f8;p=fll Security: Floating point exception due to incorrect number type used in conversion function. The power is being used as the entire value. To do this it must be capable of holding the entire supported digits of f_number_unsigned_t. Using int results in a floating point exception. --- diff --git a/level_0/f_conversion/c/private-conversion.c b/level_0/f_conversion/c/private-conversion.c index 72d0e67..248071a 100644 --- a/level_0/f_conversion/c/private-conversion.c +++ b/level_0/f_conversion/c/private-conversion.c @@ -88,7 +88,7 @@ extern "C" { f_status_t private_f_conversion_digit_to_file_number(const f_conversion_data_t data, f_number_unsigned_t number, int digits, FILE * const stream) { f_number_unsigned_t current = 0; - int power = 1; + f_number_unsigned_t power = 1; f_number_unsigned_t work = 0; for (register uint8_t i = 1; i < digits; ++i) {