Add exceptions for ucnv 17/233217/2 submit/tizen/20200526.022229
authorHyunjee Kim <hj0426.kim@samsung.com>
Wed, 13 May 2020 05:49:26 +0000 (14:49 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Thu, 14 May 2020 08:11:02 +0000 (17:11 +0900)
Change-Id: Ibccb65be6b942081f85f2cbccd33a13223fc3858
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
src/utils_i18n_ucnv.c

index 533ad86..78ec66e 100644 (file)
 
 int i18n_ucnv_get_max_bytes_for_string(int32_t length, int32_t max_char_size)
 {
+       if(length < 0 || max_char_size < 0) {
+               set_last_result(I18N_ERROR_INVALID_PARAMETER);
+               return -1;
+       }
+
+       set_last_result(I18N_ERROR_NONE);
        return ((int32_t)(length)+10)*(int32_t)(max_char_size);
 }