From e83fec57895450e499f88e7bd508db766d393def 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 30aa464..c0d3404 100644 --- a/level_1/fl_conversion/c/private-conversion.c +++ b/level_1/fl_conversion/c/private-conversion.c @@ -161,6 +161,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_array_length_t i = 0; i < length; ++i) { @@ -257,6 +260,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_array_length_t i = 0; i < length; ++i) { -- 1.8.3.1