[Libreoffice-commits] .: 2 commits - sw/Library_vbaswobj.mk sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jul 5 02:18:44 PDT 2011
sw/Library_vbaswobj.mk | 7 -------
sw/source/filter/ww8/ww8par.cxx | 22 ++++++++++++++++------
2 files changed, 16 insertions(+), 13 deletions(-)
New commits:
commit 778ff9af5c07d81dcf8cfac146a65ead658a5915
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 5 10:10:28 2011 +0100
compare tab layout directives to available space
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 64b1439..104cdfc 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1363,11 +1363,21 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
return;
}
- short i;
- const sal_uInt8* pDel = pData + 1; // Del - Array
- sal_uInt8 nDel = pData[0];
+ sal_uInt8 nDel = (nLen > 0) ? pData[0] : 0;
+ const sal_uInt8* pDel = pData + 1; // Del - Array
+
+ sal_uInt8 nIns = (nLen > nDel*2+1) ? pData[nDel*2+1] : 0;
const sal_uInt8* pIns = pData + 2*nDel + 2; // Ins - Array
- sal_uInt8 nIns = pData[nDel*2+1];
+
+ short nRequiredLength = 2 + 2*nDel + 2*nIns + 1*nIns;
+ if (nRequiredLength > nLen)
+ {
+ //would require more data than available to describe!, discard invalid
+ //record
+ nIns = 0;
+ nDel = 0;
+ }
+
WW8_TBD* pTyp = (WW8_TBD*)(pData + 2*nDel + 2*nIns + 2);// Typ - Array
SvxTabStopItem aAttr(0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP);
@@ -1427,14 +1437,14 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
}
SvxTabStop aTabStop;
- for (i=0; i < nDel; ++i)
+ for (short i=0; i < nDel; ++i)
{
sal_uInt16 nPos = aAttr.GetPos(SVBT16ToShort(pDel + i*2));
if( nPos != SVX_TAB_NOTFOUND )
aAttr.Remove( nPos, 1 );
}
- for (i=0; i < nIns; ++i)
+ for (short i=0; i < nIns; ++i)
{
short nPos = SVBT16ToShort(pIns + i*2);
aTabStop.GetTabPos() = nPos;
commit 0a9a9d1b19083bf978beffdc0e11064dbe2add2e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 5 09:57:57 2011 +0100
no need for extra noexecstack
diff --git a/sw/Library_vbaswobj.mk b/sw/Library_vbaswobj.mk
index 70874eb..41ee17c 100644
--- a/sw/Library_vbaswobj.mk
+++ b/sw/Library_vbaswobj.mk
@@ -141,11 +141,4 @@ $(eval $(call gb_Library_add_exception_objects,vbaswobj,\
sw/source/ui/vba/wordvbahelper \
))
-ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD, $(OS)))
-$(eval $(call gb_Library_set_ldflags,vbaswobj,\
- $$(LDFLAGS) \
- -Wl$(COMMA)-z$(COMMA)noexecstack \
-))
-endif
-
# vim: set noet sw=4 ts=4:
More information about the Libreoffice-commits
mailing list