summaryrefslogtreecommitdiff
path: root/xfa/fde/xml
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde/xml')
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser.cpp8
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp
index 51507526c2..78382058ec 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp
@@ -105,10 +105,12 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser(
m_CurNode.iNodeNum = -1;
m_CurNode.eNodeType = FDE_XMLNODE_Unknown;
- m_iXMLPlaneSize = std::min(m_iXMLPlaneSize, m_pStream->GetLength());
+ m_iXMLPlaneSize =
+ std::min(m_iXMLPlaneSize,
+ pdfium::base::checked_cast<FX_STRSIZE>(m_pStream->GetLength()));
m_iCurrentPos = m_pStream->GetBOMLength();
- FX_SAFE_INT32 alloc_size_safe = m_iXMLPlaneSize;
+ FX_SAFE_STRSIZE alloc_size_safe = m_iXMLPlaneSize;
alloc_size_safe += 1; // For NUL.
if (!alloc_size_safe.IsValid() || alloc_size_safe.ValueOrDie() <= 0) {
m_syntaxParserResult = FDE_XmlSyntaxResult::Error;
@@ -146,7 +148,7 @@ FDE_XmlSyntaxResult CFDE_XMLSyntaxParser::DoSyntaxParse() {
m_pStream->Seek(FX_STREAMSEEK_Begin, m_iCurrentPos);
}
m_iBufferChars =
- m_pStream->ReadString(m_Buffer.data(), m_iXMLPlaneSize, m_bEOS);
+ m_pStream->ReadString(m_Buffer.data(), m_iXMLPlaneSize, &m_bEOS);
iPos = m_pStream->GetPosition();
if (m_iBufferChars < 1) {
m_iCurrentPos = iStreamLength;
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.h b/xfa/fde/xml/cfde_xmlsyntaxparser.h
index 9f1274fa83..f229cc02b1 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser.h
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser.h
@@ -98,7 +98,7 @@ class CFDE_XMLSyntaxParser {
void ParseTextChar(wchar_t ch);
CFX_RetainPtr<IFGAS_Stream> m_pStream;
- int32_t m_iXMLPlaneSize;
+ FX_STRSIZE m_iXMLPlaneSize;
int32_t m_iCurrentPos;
int32_t m_iCurrentNodeNum;
int32_t m_iLastNodeNum;