summaryrefslogtreecommitdiff
path: root/vcl/source/font
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-23 10:56:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-23 13:11:31 +0200
commit046af4edd35f4a802bc0b1e185125339544a683b (patch)
tree2ea0654ce914c9ed97edf64c6297688120046bda /vcl/source/font
parent2f135f9e319beb0aea28c26eb9e39e50a6851a6e (diff)
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@redhat.com>
Diffstat (limited to 'vcl/source/font')
-rw-r--r--vcl/source/font/fontcharmap.cxx4
1 files changed, 3 insertions, 1 deletions
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 )