summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_program.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-05-10 17:44:53 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-11 01:00:39 +0000
commit4da1e7623c52572bc8677ac53b908f39543f13b1 (patch)
tree92f14dd5fb32795c54a326b1b5be3c9146b6cfd6 /xfa/fxfa/fm2js/xfa_program.cpp
parentbdc4580d450f84f094a93a0227a3f708416bc563 (diff)
downloadpdfium-4da1e7623c52572bc8677ac53b908f39543f13b1.tar.xz
Limit XFA FormCalc program translation size.
BUG=chromium:665087,chromium:718492 Change-Id: I09e93b4167ab2c0b3b53641243aa0cbeb5b98c4f Reviewed-on: https://pdfium-review.googlesource.com/3114 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_program.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_program.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fxfa/fm2js/xfa_program.cpp b/xfa/fxfa/fm2js/xfa_program.cpp
index 514b7a6a23..6afe332629 100644
--- a/xfa/fxfa/fm2js/xfa_program.cpp
+++ b/xfa/fxfa/fm2js/xfa_program.cpp
@@ -33,7 +33,8 @@ int32_t CXFA_FMProgram::ParseProgram() {
}
int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf& wsJavaScript) {
- m_globalFunction->ToJavaScript(wsJavaScript);
+ if (!m_globalFunction->ToJavaScript(wsJavaScript))
+ return -1;
wsJavaScript.AppendChar(0);
return 0;
}