From b793255f3352ea82e5fa5b96e2af3184589c5fe8 Mon Sep 17 00:00:00 2001 From: Lukasz Pik Date: Tue, 27 Jun 2017 10:18:47 +0200 Subject: [PATCH] [Base-utils][Measure format] Undelete handler for invalid enum argument Change-Id: I0af4524107e36308a81b4d43a30aa085d58c4836 Signed-off-by: Lukasz Pik --- src/utils_i18n_measure_format.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils_i18n_measure_format.cpp b/src/utils_i18n_measure_format.cpp index f8c71d4..acef44b 100644 --- a/src/utils_i18n_measure_format.cpp +++ b/src/utils_i18n_measure_format.cpp @@ -29,6 +29,8 @@ int i18n_measure_format_create(const char *language, i18n_measure_format_h *measure_format) { retv_if(measure_format == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(width < I18N_UMEASFMT_WIDTH_WIDE, I18N_ERROR_INVALID_PARAMETER); + retv_if(width >= I18N_UMEASFMT_WIDTH_COUNT, I18N_ERROR_INVALID_PARAMETER); UErrorCode status = U_ZERO_ERROR; Locale locale(language, country, 0, 0); UMeasureFormatWidth icu_width = (UMeasureFormatWidth) width; -- 2.34.1