diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-04 19:13:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-04 20:33:49 +0100 |
commit | 98151bf95bda8d647310bdba6936dc6b388b05de (patch) | |
tree | 0304c5be9e32a8011aa02e3adf51c51c033c280a /sw/source/filter/ww8/ww8par2.cxx | |
parent | 6c81597663d07fd0c1043cc83410e1bfd42e08b4 (diff) |
ofz: check olst sprm for valid ANLD payload len
Change-Id: Ic1b6681a3f48ef0fe3f52eda9db8b7bc003ded55
Diffstat (limited to 'sw/source/filter/ww8/ww8par2.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 67a7b05c5f12..18829c483951 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -950,6 +950,14 @@ void SwWW8ImplReader::Read_OLST( sal_uInt16, const sal_uInt8* pData, short nLen m_pNumOlst = nullptr; return; } + + if (static_cast<size_t>(nLen) < sizeof(WW8_OLST)) + { + SAL_WARN("sw.ww8", "WW8_OLST property is " << nLen << " long, needs to be at least " << sizeof(WW8_OLST)); + m_pNumOlst = nullptr; + return; + } + m_pNumOlst = new WW8_OLST; if( nLen < sal::static_int_cast< sal_Int32 >(sizeof( WW8_OLST )) ) // fill if to short memset( m_pNumOlst, 0, sizeof( *m_pNumOlst ) ); |