summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-09 11:30:00 +0000
committerAndras Timar <andras.timar@collabora.com>2015-01-12 09:22:49 +0100
commit20abcacca02a146519539289b4435570965c61c0 (patch)
treef605f91d3777e4187383cc05edfd28f73936bf20 /sw
parent22ef9f282d89958283145a664a3e48b0f55a2e4e (diff)
asan: global-buffer-overflow on ooo12093-1.doc
Change-Id: I5e29626fe2803d2751bdec9c6919662ea37cf64c Reviewed-on: https://gerrit.libreoffice.org/13820 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit f35d61f021fc46b48ca1978ef6092e56a25c446a)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index bf1d5645804a..7e085bf0ad8e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5002,7 +5002,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
aInfo.ePos = FTNPOS_PAGE;
aInfo.eNum = eNumA[pWDop->rncFtn];
- aInfo.aFmt.SetNumberingType( static_cast< sal_uInt16 >(eNumTA[pWDop->nfcFtnRef]) );
+ sal_uInt16 nfcFtnRef = pWDop->nfcFtnRef & 0xF;
+ aInfo.aFmt.SetNumberingType( static_cast< sal_uInt16 >(eNumTA[nfcFtnRef]) );
if( pWDop->nFtn )
aInfo.nFtnOffset = pWDop->nFtn - 1;
rDoc.SetFtnInfo( aInfo );
@@ -5011,8 +5012,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
{
SwEndNoteInfo aInfo;
aInfo = rDoc.GetEndNoteInfo(); // Same as for Ftn
-
- aInfo.aFmt.SetNumberingType( static_cast< sal_uInt16 >(eNumTA[pWDop->nfcEdnRef]) );
+ sal_uInt16 nfcEdnRef = pWDop->nfcEdnRef & 0xF;
+ aInfo.aFmt.SetNumberingType( static_cast< sal_uInt16 >(eNumTA[nfcEdnRef]) );
if( pWDop->nEdn )
aInfo.nFtnOffset = pWDop->nEdn - 1;
rDoc.SetEndNoteInfo( aInfo );