From fd516d050dff8e7d7ba2721bc84c245b6fa10a32 Mon Sep 17 00:00:00 2001 From: Hyunjee Kim Date: Mon, 23 Oct 2017 14:11:49 +0900 Subject: [PATCH] Fix svace error - 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 --- src/utils_i18n_timezone.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils_i18n_timezone.cpp b/src/utils_i18n_timezone.cpp index 5e773ef..bec85fb 100755 --- a/src/utils_i18n_timezone.cpp +++ b/src/utils_i18n_timezone.cpp @@ -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); -- 2.34.1