summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-19 14:28:12 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-19 14:28:12 -0800
commitffc26c26f0ab004fbdb05195e1686d7f33983b06 (patch)
tree9bc8f16d1bc7dc32e924fb5c173a561c03eac3d9 /xfa
parent11d33361e95d5ea61ee43e4261fa8f53aa372731 (diff)
downloadpdfium-ffc26c26f0ab004fbdb05195e1686d7f33983b06.tar.xz
Revert "Use safe arithmentic in CFX_BinaryBuf::ExpandBuf."
This reverts commit 78353d5dbc0b0c9b2d6946005439a51efa7d108c. Reason for revert Failed tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1719493002 .
Diffstat (limited to 'xfa')
-rw-r--r--xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp25
-rw-r--r--xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp4
2 files changed, 10 insertions, 19 deletions
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
index 77cf79bd7b..529474f5eb 100644
--- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
@@ -3760,9 +3760,8 @@ void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString,
++i;
}
wsResultBuf.AppendChar(0);
- szResultString.Clear();
- szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultString =
+ FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultString) {
@@ -3834,9 +3833,8 @@ void CXFA_FM2JSContext::DecodeHTML(const CFX_ByteStringC& szHTMLString,
++i;
}
wsResultBuf.AppendChar(0);
- szResultString.Clear();
- szResultString << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultString =
+ FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultString) {
@@ -3932,8 +3930,7 @@ void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
iCode = 0;
}
wsXMLBuf.AppendChar(0);
- szResultString.Clear();
- szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength());
+ szResultString = FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength());
}
void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
const CFX_ByteStringC& szFuncName,
@@ -4086,9 +4083,7 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
}
}
wsResultBuf.AppendChar(0);
- szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf = FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
CFX_ByteTextBuf& szResultBuf) {
@@ -4140,9 +4135,7 @@ void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString,
++i;
}
wsResultBuf.AppendChar(0);
- szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf = FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultBuf) {
@@ -4222,9 +4215,7 @@ void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
}
}
wsResultBuf.AppendChar(0);
- szResultBuf.Clear();
- szResultBuf << FX_UTF8Encode(wsResultBuf.GetBuffer(),
- wsResultBuf.GetLength());
+ szResultBuf = FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
uint32_t& iCode) {
diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp
index 7048c38d5a..c67681f6ba 100644
--- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp
+++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp
@@ -447,8 +447,8 @@ CXFA_FMCallExpression::~CXFA_FMCallExpression() {
}
}
FX_BOOL CXFA_FMCallExpression::IsBuildInFunc(CFX_WideTextBuf& funcName) {
- uint32_t uHash =
- FX_HashCode_String_GetW(funcName.GetBuffer(), funcName.GetLength(), TRUE);
+ int32_t iLength = funcName.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(funcName.GetBuffer(), iLength, TRUE);
XFA_FMBuildInFunc buildinfunction;
int32_t iStart = 0,
iEnd = (sizeof(buildInFuncs) / sizeof(buildInFuncs[0])) - 1;