Fix for ASAN issue TFIVE-12953 Stack-buffer-overflow in calendar-service 06/189206/2 accepted/tizen/unified/20180925.130756 submit/tizen/20180925.102859
authorkamaljeet <kamal.jc@samsung.com>
Fri, 14 Sep 2018 07:22:15 +0000 (12:52 +0530)
committerkamaljeet <kamal.jc@samsung.com>
Wed, 19 Sep 2018 11:04:38 +0000 (16:34 +0530)
Change-Id: I9f4530b325be46c69ebee0998a49a1158fd172c6
Signed-off-by: kamaljeet <kamal.jc@samsung.com>
common/cal_time.cpp

index 8022552..2520006 100644 (file)
@@ -441,7 +441,7 @@ bool cal_time_is_available_tzid(char *tzid)
        for (i = 0; i < s_count; i++) {
                char buf[CAL_STR_SHORT_LEN32] = {0};
                const UnicodeString *unicode_tzid = s->snext(ec);
-               for (j = 0; j < unicode_tzid->length(); j++) {
+               for (j = 0; j < unicode_tzid->length() && j < CAL_STR_SHORT_LEN32 - 1; j++) {
                        buf[j] = unicode_tzid->charAt(j);
                }
                buf[j] = '\0';