Kaydet (Commit) 9048f4e0 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

cid 703925 : strncpy can lead to non-null terminated string

Change-Id: Idfe2278d0008715a2e0f06d60df9af430e4df25c
Reviewed-on: https://gerrit.libreoffice.org/874Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 0c120f9d
...@@ -2051,7 +2051,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, ...@@ -2051,7 +2051,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
if( !*pFontName ) { if( !*pFontName ) {
if( mnFontNameSID) { if( mnFontNameSID) {
// get the fontname directly if available // 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) { } else if( mnFullNameSID) {
// approximate fontname as fullname-whitespace // approximate fontname as fullname-whitespace
const char* pI = getString( mnFullNameSID); const char* pI = getString( mnFullNameSID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment