Fix svace error 93/156993/1 tizen_3.0 submit/tizen_3.0/20171116.055838
authorHyunjee Kim <hj0426.kim@samsung.com>
Mon, 23 Oct 2017 05:11:49 +0000 (14:11 +0900)
committerhyunjee Kim <hj0426.kim@samsung.com>
Mon, 23 Oct 2017 05:16:10 +0000 (05:16 +0000)
- Return value of a function 'icu::TimeZone::createDefault' is dereferenced at utils_i18n_timezone.cpp:205 without checking,

Change-Id: Icdf36c2a13cb13b52b5cbc57d0250237f09909b5
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
src/utils_i18n_timezone.cpp

index c4a9fb1c7490bd1eaf6b696a975846ee70d1cc11..c3cc68e44172b37cb6fb47d80b1183a500547fc3 100755 (executable)
@@ -199,7 +199,10 @@ int i18n_timezone_create_default(i18n_timezone_h *timezone)
 {
     retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER);
     *timezone = TimeZone::createDefault();
+
        //Implement fallback mechanism to set the time zone to default time zone
+       if (*timezone == NULL)
+               return I18N_ERROR_INVALID_PARAMETER;
        char* zoneInfo = NULL;
        UnicodeString TimezoneID;
        ((TimeZone *) *timezone)->getID(TimezoneID);