From a70d00b37b1120edbad6d8bbd0836457e5db6259 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 24 Feb 2024 15:17:46 -0600 Subject: [PATCH] Security: Conversion is not handling NULL case when base unit is an unsupported type. --- level_1/fl_conversion/c/private-conversion.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- 1.8.3.1