ref: 1eca33b48c25d3ee58691ea8f9d122cdf12a57a6
parent: e624b7ffb8afbf1559e19817063b34968e80a7f8
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 3 03:22:02 EST 2019
always zero initialize Tm structure for tm2sec()
--- a/sys/src/cmd/cifs/pack.c
+++ b/sys/src/cmd/cifs/pack.c
@@ -439,6 +439,7 @@
d = gl16(p);
}
+ memset(&tm, 0, sizeof(tm));
tm.year = 80 + (d >> 9);
tm.mon = ((d >> 5) & 017) - 1;
tm.mday = d & 037;
--- a/sys/src/cmd/dossrv/dossubs.c
+++ b/sys/src/cmd/dossrv/dossubs.c
@@ -1750,6 +1750,8 @@
int i;
i = GSHORT(dp->time);
+
+ memset(&tm, 0, sizeof(tm));
tm.hour = i >> 11;
tm.min = (i >> 5) & 63;
tm.sec = (i & 31) << 1;
--- a/sys/src/cmd/gzip/unzip.c
+++ b/sys/src/cmd/gzip/unzip.c
@@ -764,6 +764,7 @@
{
Tm tm;
+ memset(&tm, 0, sizeof(tm));
tm.hour = time >> 11;
tm.min = (time >> 5) & 63;
tm.sec = (time & 31) << 1;
--- a/sys/src/cmd/ip/cifsd/util.c
+++ b/sys/src/cmd/ip/cifsd/util.c
@@ -101,6 +101,7 @@
{
Tm tm;
+ memset(&tm, 0, sizeof(tm));
strcpy(tm.zone, "GMT");
tm.mday = date & 0x1f;
tm.mon = ((date >> 5) & 0xf) - 1;
--- a/sys/src/cmd/tapefs/zipfs.c
+++ b/sys/src/cmd/tapefs/zipfs.c
@@ -376,6 +376,7 @@
{
Tm tm;
+ memset(&tm, 0, sizeof(tm));
tm.hour = time >> 11;
tm.min = (time >> 5) & 63;
tm.sec = (time & 31) << 1;
--- a/sys/src/cmd/webcookies.c
+++ b/sys/src/cmd/webcookies.c
@@ -636,6 +636,8 @@
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
};
+ memset(&tm, 0, sizeof(tm));
+
os = s;
/* Sunday, */
for(i=0; i<nelem(wday); i++){
--- a/sys/src/libhttpd/date.c
+++ b/sys/src/libhttpd/date.c
@@ -113,6 +113,8 @@
Tm tm;
char buf[32];
+ memset(&tm, 0, sizeof(tm));
+
/*
* Weekday|Wday
*/