diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-05 15:33:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-06 13:53:19 +0000 |
commit | 81f9eeef041f2974274751d7508598049ae32db2 (patch) | |
tree | 00bdcdddc9d141e4929005a14372bde65c68ee81 /xfa/fxfa/parser | |
parent | 3ef61c73a97b31000a21e323e04ad5397e517c4c (diff) | |
download | pdfium-81f9eeef041f2974274751d7508598049ae32db2.tar.xz |
Convert FX_STRSIZE int->size_t
Change the underlying type for FX_STRSIZE to size_t from int. This
will make the value unsigned and thus all values in the range of the
type will be valid. This allows for the final remove of negative
length strings, but also introduces a some casting and functional
errors, since many parts of the code base assume that FX_STRSIZE is
int or another signed type. This also CL fixes these errors.
BUG=pdfium:828
Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b
Reviewed-on: https://pdfium-review.googlesource.com/11830
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_scriptcontext.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp index e7c86296ee..98b5da057f 100644 --- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp +++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp @@ -624,7 +624,9 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refObject, bool bCreate = m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode( rndFind.m_wsName, rndFind.m_wsCondition, - nStart == wsExpression.GetLength(), this); + nStart == + pdfium::base::checked_cast<int32_t>(wsExpression.GetLength()), + this); if (bCreate) { continue; } else { @@ -650,7 +652,9 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refObject, continue; } if (rndFind.m_dwFlag == XFA_RESOVENODE_RSTYPE_Attribute && - rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) { + rndFind.m_pScriptAttribute && + nStart < + pdfium::base::checked_cast<int32_t>(wsExpression.GetLength())) { auto pValue = pdfium::MakeUnique<CFXJSE_Value>(m_pIsolate); (rndFind.m_Objects.front() ->*(rndFind.m_pScriptAttribute->lpfnCallback))( @@ -679,7 +683,9 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refObject, bool bCreate = m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode( rndFind.m_wsName, rndFind.m_wsCondition, - nStart == wsExpression.GetLength(), this); + nStart == pdfium::base::checked_cast<int32_t>( + wsExpression.GetLength()), + this); if (bCreate) { continue; } else { |