summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/fontsubset/cff.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index bcb94e509613..93817ff35f68 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -2051,7 +2051,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
if( !*pFontName ) {
if( mnFontNameSID) {
// get the fontname directly if available
- strncpy( pFontName, getString( mnFontNameSID), sizeof(rEmitter.maSubsetName));
+ strncpy( pFontName, getString( mnFontNameSID), sizeof(rEmitter.maSubsetName) - 1);
+ pFontName[sizeof(rEmitter.maSubsetName) - 1] = 0;
} else if( mnFullNameSID) {
// approximate fontname as fullname-whitespace
const char* pI = getString( mnFullNameSID);