RC3 svace fix (cloudClient + crlresource.c)
[platform/upstream/iotivity.git] / resource / csdk / security / src / crlresource.c
index 46a82fb..12d4f0b 100644 (file)
@@ -458,11 +458,16 @@ static void getCurrentUTCTime(char *out, size_t len)
 {
     //TODO: how to implement it in cross-platform way?
     time_t rawtime;
-    struct tm * timeinfo;
+    struct tm * timeinfo = NULL;
 
     time ( &rawtime );
     timeinfo = localtime ( &rawtime );
 
+    if (NULL == timeinfo)
+    {
+        return;
+    }
+
     snprintf(out, len, "%04d%02d%02d%02d%02d%02d",
             timeinfo->tm_year + 1900, timeinfo->tm_mon + 1, timeinfo->tm_mday,
             timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);