[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 23 11:12:07 UTC 2020
vcl/source/font/fontcharmap.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 046af4edd35f4a802bc0b1e185125339544a683b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 23 10:56:00 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 23 13:11:31 2020 +0200
ofz#25868 Timeout, encoding conversion only sane in 0..SAL_MAX_UINT16 range
so ignore points outside that range to avoid ludicrous ranges that aren't
possible in the input encoding
Change-Id: Ifb7b9b389d4a31b8820a7da661249223fe1e110c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103237
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index cf2c839ef8d5..5b6b829d206a 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -341,7 +341,9 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
{
sal_UCS4 cMin = *(pCP++);
sal_UCS4 cEnd = *(pCP++);
- while( cMin < cEnd )
+ // ofz#25868 the conversion only makes sense with
+ // input codepoints in 0..SAL_MAX_UINT16 range
+ while (cMin < cEnd && cMin <= SAL_MAX_UINT16)
{
int j = 0;
for(; (cMin < cEnd) && (j < NINSIZE); ++cMin )
More information about the Libreoffice-commits
mailing list