From: Kevin Day Date: Sat, 24 Feb 2024 21:17:46 +0000 (-0600) Subject: Security: Conversion is not handling NULL case when base unit is an unsupported type. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=a70d00b37b1120edbad6d8bbd0836457e5db6259;p=fll Security: Conversion is not handling NULL case when base unit is an unsupported type. --- diff --git a/level_1/fl_conversion/c/private-conversion.c b/level_1/fl_conversion/c/private-conversion.c index 7148c70..0cb22ae 100644 --- a/level_1/fl_conversion/c/private-conversion.c +++ b/level_1/fl_conversion/c/private-conversion.c @@ -151,6 +151,9 @@ extern "C" { else if (data.base == 8) { character_to_digit = f_conversion_character_to_octal; } + else { + return F_status_set_error(F_parameter); + } for (f_number_unsigned_t i = 0; i < length; ++i) { @@ -245,6 +248,9 @@ extern "C" { else if (data.base == 8) { character_to_digit = f_conversion_character_to_octal; } + else { + return F_status_set_error(F_parameter); + } for (f_number_unsigned_t i = 0; i < length; ++i) {