Kaydet (Commit) 1bf5b5b7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

This presumably always wanted to check for SAL_MAX_UINT16, not USHRT_MAX

The check against USHRT_MAX was introduced with
9c034462 "INTEGRATION: CWS cmcfixes30: #i72614#
crash in loading corrupt .doc", apparently to ensure the static_cast<sal_uInt16>
in the call to ShortToSVBT16 below (which already was that same
static_cast<sal_uInt16> back tehn) is OK.

Change-Id: Ie385f0f490cab1c59bce07fa25bd9b92e3ad286a
Reviewed-on: https://gerrit.libreoffice.org/48439Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 3475b95a
...@@ -2305,8 +2305,9 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN) ...@@ -2305,8 +2305,9 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN)
if (!failure) if (!failure)
{ {
// Check arguments to ShortToSVBT16 in loop below will all be valid:
sal_Int32 nResult; sal_Int32 nResult;
failure = o3tl::checked_add(nPN, ncpN, nResult) || nResult > USHRT_MAX; failure = o3tl::checked_add(nPN, ncpN, nResult) || nResult > SAL_MAX_UINT16;
} }
if (!failure) if (!failure)
......
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