Kaydet (Commit) 34a7a7ff authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#3121 check bounds better

Change-Id: Ib1eacda7e4cdf1d0238532f4e38059a9c30556ac
Reviewed-on: https://gerrit.libreoffice.org/41626Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2cd576c3
......@@ -186,7 +186,7 @@ void CGM::ImplDoClass4()
sal_uInt32 nType = ImplGetUI16();
sal_uInt32 nSize = ImplGetUI( 1 );
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[mnParaSize + nSize] = 0;
......@@ -224,7 +224,7 @@ void CGM::ImplDoClass4()
sal_uInt32 nType = ImplGetUI16();
sal_uInt32 nSize = ImplGetUI(1);
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[ mnParaSize + nSize ] = 0;
......@@ -242,7 +242,7 @@ void CGM::ImplDoClass4()
(void)ImplGetUI16(); // nType
sal_uInt32 nSize = ImplGetUI( 1 );
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[ mnParaSize + nSize ] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment