diff options
author | Hyunjee Kim <hj0426.kim@samsung.com> | 2016-11-29 17:42:03 +0900 |
---|---|---|
committer | Hyunjee Kim <hj0426.kim@samsung.com> | 2016-11-30 11:24:03 +0900 |
commit | 64e49558fe8a67b138e6596dccff41faa32ba192 (patch) | |
tree | c1a5d88a6920a9715bccb0472546474429c1c497 | |
parent | 7791bee76552c221c457c8c6a10d4451cfc76070 (diff) | |
download | base-utils-accepted/tizen_3.0.m2_tv.tar.gz base-utils-accepted/tizen_3.0.m2_tv.tar.bz2 base-utils-accepted/tizen_3.0.m2_tv.zip |
Fix TC error + some errorssubmit/tizen_3.0/20161201.062533submit/tizen_3.0.m2/20170104.093748accepted/tizen/3.0/wearable/20161202.005708accepted/tizen/3.0/tv/20161202.005650accepted/tizen/3.0/mobile/20161202.005632accepted/tizen/3.0/ivi/20161202.005728accepted/tizen/3.0/common/20161203.012224accepted/tizen/3.0.m2/wearable/20170104.100919accepted/tizen/3.0.m2/tv/20170104.100351accepted/tizen/3.0.m2/mobile/20170104.100153tizen_3.0.m2accepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobile
Change-Id: I0d34bcb478ce66d3ebcc57a4ccf0fb4280e6db4d
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
-rw-r--r-- | src/utils_i18n_ubidi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/utils_i18n_ubidi.c b/src/utils_i18n_ubidi.c index 43b9697..03449b7 100644 --- a/src/utils_i18n_ubidi.c +++ b/src/utils_i18n_ubidi.c @@ -263,13 +263,18 @@ int i18n_ubidi_get_text(const i18n_ubidi_h ubidi, char **text) * UTF-16 uses at least two bytes, growing up to four bytes as necessary, * that is why we multiply UChar by 4. */ - char _text[4*ulen+1]; + char *_text = NULL; + _text = (char *)malloc(4 * ulen + 1); + retv_if(_text == NULL, I18N_ERROR_OUT_OF_MEMORY); + memset(_text, 0x0, 4 * ulen + 1); + u_austrcpy(_text, _ubidi_text); int32_t len = strlen(_text); *text = (char *)malloc(len + 1); retv_if(*text == NULL, I18N_ERROR_OUT_OF_MEMORY); + memset(*text, 0x0, len+1); strncpy(*text, _text, len); @@ -324,7 +329,7 @@ int i18n_ubidi_get_visual_run(i18n_ubidi_h ubidi, int i18n_ubidi_invert_map(const int32_t *scr_map, int32_t length, int32_t *dest_map) { - retv_if(scr_map == NULL || dest_map == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(scr_map == NULL || dest_map == NULL || length <= 0, I18N_ERROR_INVALID_PARAMETER); ubidi_invertMap(scr_map, dest_map, length); |