summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/fgas_stream.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-03-31 09:45:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-31 09:45:20 -0700
commit11ac93cfdb9f4f25eee2ba60b947f992ab40ec54 (patch)
tree9738d127550a1aaa47e8828c3890c842da7dcf6f /xfa/fgas/crt/fgas_stream.cpp
parent5a839e938bad5b766a928fb545f0b0aba39e3829 (diff)
downloadpdfium-11ac93cfdb9f4f25eee2ba60b947f992ab40ec54.tar.xz
Fix CData parsing in CFDE_XMLSyntaxParser.
This CL splits the handling of CData sections out to an individual phase of the parser. This fixes the issue with the CData parser getting confused by < characters inside the data section. BUG=pdfium:90 Review URL: https://codereview.chromium.org/1842633004
Diffstat (limited to 'xfa/fgas/crt/fgas_stream.cpp')
-rw-r--r--xfa/fgas/crt/fgas_stream.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 8ab2f9fd37..94468e23da 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -870,8 +870,9 @@ int32_t CFX_BufferStreamImp::ReadString(FX_WCHAR* pStr,
}
const FX_WCHAR* pSrc = (const FX_WCHAR*)(FX_CHAR*)(m_pData + m_iPosition);
int32_t iCount = 0;
- while (*pSrc != L'\0' && iCount < iLen) {
- *pStr++ = *pSrc++, iCount++;
+ while (*pSrc && iCount < iLen) {
+ *pStr++ = *pSrc++;
+ iCount++;
}
m_iPosition += iCount * 2;
bEOS = (*pSrc == L'\0') || (m_iPosition >= m_iLength);
@@ -1345,6 +1346,7 @@ int32_t CFX_Stream::ReadString(FX_WCHAR* pStr,
}
return iLen;
}
+
int32_t CFX_Stream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
if (m_pStreamImp == NULL) {