From: Hyunjee Kim Date: Wed, 13 May 2020 05:49:26 +0000 (+0900) Subject: Add exceptions for ucnv X-Git-Tag: submit/tizen/20200526.022229^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b80ca66300d18def8ef85ab66b084e6a19f45f52;p=platform%2Fcore%2Fapi%2Fbase-utils.git Add exceptions for ucnv Change-Id: Ibccb65be6b942081f85f2cbccd33a13223fc3858 Signed-off-by: Hyunjee Kim --- diff --git a/src/utils_i18n_ucnv.c b/src/utils_i18n_ucnv.c index 533ad86..78ec66e 100644 --- a/src/utils_i18n_ucnv.c +++ b/src/utils_i18n_ucnv.c @@ -21,6 +21,12 @@ 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); }