diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-23 17:00:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-24 15:53:33 +0100 |
commit | 1bf5b5b76dc1e244c0cf871740c66794157561bd (patch) | |
tree | f10c4405c4f0b0f298e41875958977ec23836d71 /sw | |
parent | 3475b95a18f1b1368bcfc20bd3d09b9c02ec33cb (diff) |
This presumably always wanted to check for SAL_MAX_UINT16, not USHRT_MAX
The check against USHRT_MAX was introduced with
9c0344627f1767512ef5097c08e3ed7500d223da "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/48439
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 03696fb5208f..faa04a594f1a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2305,8 +2305,9 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN) if (!failure) { + // Check arguments to ShortToSVBT16 in loop below will all be valid: 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) |