[Libreoffice-commits] core.git: sax/source
Arnaud Versini
arnaud.versini at gmail.com
Tue Feb 11 02:39:23 PST 2014
sax/source/tools/converter.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 785c4f10b87ab47b853abf947dfb21117d55cca1
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Sun Feb 2 12:14:01 2014 +0100
fdo#72468 avoid out of bounds array access
Change-Id: I2bccdf1aaeb290a3cb8f76cd831a419e1776e92f
Reviewed-on: https://gerrit.libreoffice.org/7775
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 8a0d828..48ad958 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1367,7 +1367,7 @@ lcl_MaxDaysPerMonth(const sal_Int32 nMonth, const sal_Int32 nYear)
{
static const sal_uInt16 s_MaxDaysPerMonth[12] =
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- OSL_ASSERT(0 < nMonth && nMonth <= 12);
+ assert(0 < nMonth && nMonth <= 12);
if ((2 == nMonth) && lcl_isLeapYear(nYear))
{
return 29;
@@ -1545,8 +1545,8 @@ static bool lcl_parseDate(
if (!bIgnoreInvalidOrMissingDate)
{
bSuccess &= (0 < nDay);
+ bSuccess &= (nDay <= lcl_MaxDaysPerMonth(nMonth, nYear));
}
- bSuccess &= (nDay <= lcl_MaxDaysPerMonth(nMonth, nYear));
}
if (bSuccess && (nPos < string.getLength()))
More information about the Libreoffice-commits
mailing list