From: Piotr Kosko Date: Thu, 11 Jun 2015 08:49:15 +0000 (+0200) Subject: [Content] Fix for prevent issue X-Git-Tag: submit/tizen/20150702.103311^2~2^2~67^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66fcf08bb454d59d213114a94ff07fa705eda9a5;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Content] Fix for prevent issue [Feature] Fixed prevent CID: 441793 localtime replaced with localtime_r [Verification] Code compiles without errors. TCT passrate 100% Change-Id: Icdd66ed81bc07d9cfe295bbe98cbe10586138ddc Signed-off-by: Piotr Kosko --- diff --git a/src/content/content_manager.cc b/src/content/content_manager.cc index 09453b11..0c8800cb 100755 --- a/src/content/content_manager.cc +++ b/src/content/content_manager.cc @@ -55,15 +55,15 @@ const std::map orientationMap = { static int get_utc_offset() { LoggerD("Enter"); time_t zero = 24 * 60 * 60L; - struct tm* timeptr; + struct tm time_struct = {0}; int gmtime_hours = 0; /* get the local time for Jan 2, 1900 00:00 UTC */ - timeptr = localtime(&zero); - if (nullptr != timeptr) { - gmtime_hours = timeptr->tm_hour; + tzset(); + if (nullptr != localtime_r(&zero, &time_struct)) { + gmtime_hours = time_struct.tm_hour; - if (timeptr->tm_mday < 2) + if (time_struct.tm_mday < 2) gmtime_hours -= 24; } return gmtime_hours;