summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index fb2c723ce4..975592d044 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -966,7 +966,8 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont,
if (face.GetLength() >= LF_FACESIZE)
return nullptr;
- FXSYS_strcpy(lfa.lfFaceName, face.c_str());
+ strncpy(lfa.lfFaceName, face.c_str(),
+ (face.GetLength() + 1) * sizeof(CFX_ByteString::CharType));
return AddWindowsFont(&lfa, bVert, bTranslateName);
}