From: Sungmin Kwak Date: Tue, 7 Jul 2015 02:02:47 +0000 (+0900) Subject: Prevent fix X-Git-Tag: submit/tizen/20150721.021523~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ec7b881031230063be94bc483122fd4f04b2cbf;p=platform%2Fcore%2Fuifw%2Fisf.git Prevent fix Change-Id: I394edd2a6a97801f6bcb0d4dde783c9a526e5456 --- diff --git a/ism/src/scim_utility.cpp b/ism/src/scim_utility.cpp index bae722a7..d73aa74d 100644 --- a/ism/src/scim_utility.cpp +++ b/ism/src/scim_utility.cpp @@ -153,7 +153,9 @@ utf8_wctomb (unsigned char *dest, ucs4_t wc, int dest_size) return 0; int count; - if (wc < 0x80) { // most offen case + if (wc < 0) + return RET_ILSEQ; + else if (wc < 0x80) { // most offen case if (dest_size < 1) return RET_TOOSMALL; dest[0] = wc; @@ -167,10 +169,9 @@ utf8_wctomb (unsigned char *dest, ucs4_t wc, int dest_size) count = 4; else if (wc < 0x4000000) count = 5; - else if (wc <= 0x7fffffff) + else //if (wc <= 0x7fffffff) count = 6; - else - return RET_ILSEQ; + if (dest_size < count) return RET_TOOSMALL; switch (count) { /* note: code falls through cases! */