diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-09 12:09:37 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-12-10 10:27:09 +0000 |
commit | 539fda2d5527742023eb7ce537113639ed1c1982 (patch) | |
tree | 822f63398bb0bb7e9cc21dd3c8424808780e4bae | |
parent | a579905319455629975c739885e9cc4ca69ba229 (diff) |
guard against corrupt SilverBullet
(cherry picked from commit 36d55980b1b3498fecc460d3c46667e5f5a17b8e)
Reviewed-on: https://gerrit.libreoffice.org/20504
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit d387a99fce3f96f4fcd60c70909292255f12840f)
Change-Id: I3af47ab3af5e28a865a77a592f6a92edb46e4f2b
Reviewed-on: https://gerrit.libreoffice.org/20506
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r-- | lotuswordpro/source/filter/lwpsilverbullet.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx index c0c39e946cdb..e7ad33f3d3af 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.cxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx @@ -97,7 +97,10 @@ void LwpSilverBullet::Read() sal_uInt16 nNumPos = m_pObjStrm->QuickReaduInt16(); - for (sal_uInt8 nC = 0; nC < nNumPos; nC++) + if (nNumPos > SAL_N_ELEMENTS(m_pResetPositionFlags)) + throw std::range_error("corrupt SilverBullet"); + + for (sal_uInt16 nC = 0; nC < nNumPos; nC++) m_pResetPositionFlags[nC] = m_pObjStrm->QuickReaduInt8(); m_nUseCount = m_pObjStrm->QuickReaduInt32(); |