diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2014-02-02 12:14:01 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-11 10:38:53 +0000 |
commit | 785c4f10b87ab47b853abf947dfb21117d55cca1 (patch) | |
tree | 8e475d67166599a4ddc31bc999df1c109837819f /sax | |
parent | c864bd31056677277919078c4fd04966ef8b14de (diff) |
fdo#72468 avoid out of bounds array access
Change-Id: I2bccdf1aaeb290a3cb8f76cd831a419e1776e92f
Reviewed-on: https://gerrit.libreoffice.org/7775
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/converter.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 8a0d82873399..48ad958d5692 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())) |