diff --git a/README.chromium b/README.chromium index 66a574519d08e925cb7b7c81de545cac02caf434..221078f0290568218bb69b6c7a229ce480b62746 100644 --- a/README.chromium +++ b/README.chromium @@ -280,5 +280,9 @@ D. Local Modifications 8. Reduce size of SmallIntFormatter implementation - patches/simplify_smallintformatter.patch - Reduce the size of the binary by about 16 kiB on Android, - without noticeable performance change. + upstream bug: https://ssl.icu-project.org/trac/ticket/12390 + +9. Fix an integer overflow in Islamic calendar + + - patches/islamcal.patch + upstream bug: https://ssl.icu-project.org/trac/ticket/13538 diff --git a/patches/islamcal.patch b/patches/islamcal.patch new file mode 100644 index 0000000000000000000000000000000000000000..f190ed251310d2a525901b328606eb3ef110b61e --- /dev/null +++ b/patches/islamcal.patch @@ -0,0 +1,13 @@ +diff --git a/source/i18n/islamcal.cpp b/source/i18n/islamcal.cpp +index 4fd0e07d..de100242 100644 +--- a/source/i18n/islamcal.cpp ++++ b/source/i18n/islamcal.cpp +@@ -614,7 +614,7 @@ void IslamicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status) + days = julianDay - ASTRONOMICAL_EPOC; + } + // Use the civil calendar approximation, which is just arithmetic +- year = (int)ClockMath::floorDivide( (double)(30 * days + 10646) , 10631.0 ); ++ year = (int32_t)ClockMath::floorDivide( (double)(30 * (int64_t) days + 10646) , 10631.0 ); + month = (int32_t)uprv_ceil((days - 29 - yearStart(year)) / 29.5 ); + month = month<11?month:11; + startDate = monthStart(year, month); diff --git a/source/i18n/islamcal.cpp b/source/i18n/islamcal.cpp index 4fd0e07d920746d08dd3e2086a52bd4dca818298..de1002422c0d23351cf81213592238cc6df42596 100644 --- a/source/i18n/islamcal.cpp +++ b/source/i18n/islamcal.cpp @@ -614,7 +614,7 @@ void IslamicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status) days = julianDay - ASTRONOMICAL_EPOC; } // Use the civil calendar approximation, which is just arithmetic - year = (int)ClockMath::floorDivide( (double)(30 * days + 10646) , 10631.0 ); + year = (int32_t)ClockMath::floorDivide( (double)(30 * (int64_t) days + 10646) , 10631.0 ); month = (int32_t)uprv_ceil((days - 29 - yearStart(year)) / 29.5 ); month = month<11?month:11; startDate = monthStart(year, month);