diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-24 12:18:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-24 21:28:26 +0200 |
commit | 52b92a591943c1988fd3d660bd6fc5ac53ce0f33 (patch) | |
tree | b2a01fff0ac77508031009881412ccf68fa5a600 | |
parent | 3b55741586883d4fbb7f3e4c5368b5382c3ce5f8 (diff) |
cid#1209863 Untrusted loop bound
Change-Id: Ic8d20e92b4021dfebe01e1265c3afb2bcd509827
Reviewed-on: https://gerrit.libreoffice.org/76259
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/font/fontcharmap.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index b057a2056645..8d8dd5815dc1 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -232,6 +232,11 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) else if( (nFormat == 12) && ((nOffset+16) < nLength) ) { nRangeCount = GetUInt( pCmap + nOffset + 12 ); + if (nRangeCount < 0) + { + SAL_WARN("vcl.gdi", "negative RangeCount"); + nRangeCount = 0; + } const int nGroupOffset = nOffset + 16; const int nRemainingLen = nLength - nGroupOffset; |