Bug 1227497 - added memset on localtime. r?wtc
MozReview-Commit-ID: 5yXttRuTGLS
--- 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);