[Libreoffice-commits] .: 3 commits - i18npool/source svl/source vcl/source
David Tardon
dtardon at kemper.freedesktop.org
Mon May 16 08:53:02 PDT 2011
i18npool/source/indexentry/genindex_data.cxx | 2 +-
svl/source/numbers/zforscan.cxx | 4 +++-
vcl/source/gdi/outmap.cxx | 6 +++---
3 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit fa4d16cb9b11270b13ae4fe67d43d2dc60b48d07
Author: David Tardon <dtardon at redhat.com>
Date: Sat May 14 14:29:43 2011 +0200
array address is only MAX_ADDRESS wide
diff --git a/i18npool/source/indexentry/genindex_data.cxx b/i18npool/source/indexentry/genindex_data.cxx
index 13a723f..3f91de8 100644
--- a/i18npool/source/indexentry/genindex_data.cxx
+++ b/i18npool/source/indexentry/genindex_data.cxx
@@ -79,7 +79,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
sal_Int32 nPos=0;
sal_uInt32 nChar = Ostr.iterateCodePoints(&nPos, 2);
- if (nChar > MAX_ADDRESS) {
+ if (nChar >= MAX_ADDRESS) {
printf("Code point 0x%lx exceeds MAX_ADDRESS 0x%x, Please increase MAX_ADDRESS", static_cast<long unsigned int>(nChar), MAX_ADDRESS);
exit(1);
}
commit 0c8fd6cd283f803d450c417ff4f94616549de552
Author: David Tardon <dtardon at redhat.com>
Date: Sat May 14 13:59:11 2011 +0200
avoid possible array overrun
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 7610092..02910f8 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1400,11 +1400,12 @@ bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType e
{
if (nAnzStrings >= NF_MAX_FORMAT_SYMBOLS || nPos > nAnzStrings)
return false;
- ++nAnzResStrings;
if (nPos > 0 && nTypeArray[nPos-1] == NF_SYMBOLTYPE_EMPTY)
--nPos; // reuse position
else
{
+ if (nAnzStrings + 1 >= NF_MAX_FORMAT_SYMBOLS)
+ return false;
++nAnzStrings;
for (size_t i = nAnzStrings; i > nPos; --i)
{
@@ -1412,6 +1413,7 @@ bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType e
sStrArray[i] = sStrArray[i-1];
}
}
+ ++nAnzResStrings;
nTypeArray[nPos] = static_cast<short>(eType);
sStrArray[nPos] = rStr;
return true;
commit be2ec9d36b8d34e69d228199ba05c7a01483da33
Author: David Tardon <dtardon at redhat.com>
Date: Sat May 14 10:40:14 2011 +0200
avoid possible array overrun
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index f907043..e710f73 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -1861,9 +1861,9 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
#define ENTER3( eUnitSource, eUnitDest ) \
long nNumerator = 1; \
long nDenominator = 1; \
- DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit"); \
- DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit"); \
- if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) ) \
+ DBG_ASSERT( eUnitSource <= MAP_PIXEL, "nonpermitted source map unit"); \
+ DBG_ASSERT( eUnitDest <= MAP_PIXEL, "nonpermitted destination map unit"); \
+ if( (eUnitSource <= MAP_PIXEL) && (eUnitDest <= MAP_PIXEL) ) \
{ \
nNumerator = aImplNumeratorAry[eUnitSource] * \
aImplDenominatorAry[eUnitDest]; \
More information about the Libreoffice-commits
mailing list