summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorCampo Weijerman <rfc822@nl.ibm.com>2005-07-18 19:34:55 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-07-18 16:37:11 +0000
commit3574fba9d64258926d8208a0796e6f0aef583eeb (patch)
tree5d4cfc4edf8200c9702c30d785e78521c01ec32b /pp_sys.c
parent9a957fbc017c803266bc4e3766dfcbfb58cfa99b (diff)
downloadperl-3574fba9d64258926d8208a0796e6f0aef583eeb.tar.gz
Re: AIX 5.2 localtime bug attack
Message-ID: <20050718153455.GA29381@python> mday++ is also wday++ and yday++ p4raw-id: //depot/perl@25173
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 63eebef880..545765ca67 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4572,14 +4572,16 @@ static struct tm *S_my_localtime (pTHX_ Time_t *tp)
* Given that legal timezones are typically between GMT-12 and GMT+12
* we turn back the clock 23 hours before calling the localtime
* function, and add those to the return value. This will never cause
- * day wrapping problems, since the edge case is Jan *19*
+ * day wrapping problems, since the edge case is Tue Jan *19*
*/
T = *tp - 82800; /* 23 hour. allows up to GMT-23 */
P = localtime (&T);
P->tm_hour += 23;
if (P->tm_hour >= 24) {
P->tm_hour -= 24;
- P->tm_mday++;
+ P->tm_mday++; /* 18 -> 19 */
+ P->tm_wday++; /* Mon -> Tue */
+ P->tm_yday++; /* 18 -> 19 */
}
return (P);
} /* S_my_localtime */