summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2019-05-16 21:19:55 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2019-05-20 13:02:35 +0200
commit0921b596cc897ebc1fd57988b475aa7b430812f0 (patch)
tree68134db0667f4c5ee4273e6139e9a6d0f27886ad
parent29414ac96203af9982d7f65cf5385224b6d675f4 (diff)
downloadlibxslt-0921b596cc897ebc1fd57988b475aa7b430812f0.tar.gz
Fix unsigned integer overflow in date.c
-rw-r--r--libexslt/date.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexslt/date.c b/libexslt/date.c
index d075adc5..60deffff 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -141,9 +141,9 @@ struct _exsltDateDurVal {
#define IS_LEAP(y) \
(((y & 3) == 0) && ((y % 25 != 0) || ((y & 15) == 0)))
-static const unsigned long daysInMonth[12] =
+static const long daysInMonth[12] =
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-static const unsigned long daysInMonthLeap[12] =
+static const long daysInMonthLeap[12] =
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
#define MAX_DAYINMONTH(yr,mon) \
@@ -177,9 +177,9 @@ static const unsigned long daysInMonthLeap[12] =
#define DAYS_PER_EPOCH (400 * 365 + 100 - 4 + 1)
#define YEARS_PER_EPOCH 400
-static const unsigned long dayInYearByMonth[12] =
+static const long dayInYearByMonth[12] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
-static const unsigned long dayInLeapYearByMonth[12] =
+static const long dayInLeapYearByMonth[12] =
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
#define DAY_IN_YEAR(day, month, year) \