[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 24 06:31:36 UTC 2020


 vcl/source/font/fontcharmap.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2cb39ffeec2ff79cecea55ee807328f40bafc5b2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 23 10:56:00 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Sep 24 08:31:02 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/+/103191
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index fcf0c2c64f52..229f4f36789f 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -339,7 +339,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