Fix svace error 89/156989/3 accepted/tizen/unified/20171117.060138 submit/tizen/20171116.055510
authorHyunjee Kim <hj0426.kim@samsung.com>
Mon, 23 Oct 2017 05:11:49 +0000 (14:11 +0900)
committerhyunjee Kim <hj0426.kim@samsung.com>
Thu, 16 Nov 2017 05:41:49 +0000 (05:41 +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 5e773ef..bec85fb 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);