Bug 1227497 - added memset on localtime. r?wtc draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Fri, 09 Sep 2016 12:03:49 +0300
changeset 412067 66ba908e9c36b2ab851d2d67bacb3825612191d2
parent 411433 77940cbf0c2a9f52c209fbbde5b2e7d4c74a1501
child 530875 881577792fb22e0ccdcb0411b28ba0c4d37c8d10
push id29049
push userbmo:bpostelnicu@mozilla.com
push dateFri, 09 Sep 2016 09:04:20 +0000
reviewerswtc
bugs1227497
milestone51.0a1
Bug 1227497 - added memset on localtime. r?wtc MozReview-Commit-ID: 5yXttRuTGLS
nsprpub/pr/src/misc/prtime.c
--- a/nsprpub/pr/src/misc/prtime.c
+++ b/nsprpub/pr/src/misc/prtime.c
@@ -601,16 +601,19 @@ PR_LocalTimeParameters(const PRExplodedT
      * Caveat: the validity of this calculation depends on two
      * assumptions:
      * 1. Daylight saving time was not in effect on Jan. 2, 1970.
      * 2. The time zone of the geographic location has not changed
      *    since Jan. 2, 1970.
      */
 
     secs = 86400L;
+
+    memset(&localTime, 0, sizeof(struct tm));
+
     (void) MT_safe_localtime(&secs, &localTime);
 
     /* GMT is 00:00:00, 2nd of Jan. */
 
     offset2Jan1970 = (PRInt32)localTime.tm_sec 
             + 60L * (PRInt32)localTime.tm_min
             + 3600L * (PRInt32)localTime.tm_hour
             + 86400L * (PRInt32)((PRInt32)localTime.tm_mday - 2L);