summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-26 21:02:52 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-26 21:02:52 +0000
commit0bc02c152bd0c178a5946196e2054a5cdc7650f4 (patch)
tree4a651b86f0d240c4996ea77f041274d241e59c93 /xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
parent611431decd9a5b7dd456355fe763b2dee9c2a1a1 (diff)
downloadpdfium-0bc02c152bd0c178a5946196e2054a5cdc7650f4.tar.xz
Add some more missing consts.chromium/3356
Get things out of the .data section. Change-Id: I375cf00186a3d5d8d10f5d147bd4b692f5db3683 Reviewed-on: https://pdfium-review.googlesource.com/27130 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
index 14f87a68f5..f4cd1be472 100644
--- a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
+++ b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
@@ -10,13 +10,17 @@ class CXFA_FMToJavaScriptDepth {
CXFA_FMToJavaScriptDepth() { depth_++; }
~CXFA_FMToJavaScriptDepth() { depth_--; }
- bool IsWithinMaxDepth() const { return depth_ <= max_depth_; }
+ bool IsWithinMaxDepth() const { return depth_ <= kMaxDepth; }
static void Reset();
private:
+ // Arbitarily picked by looking at how deep a translation got before hitting
+ // the getting fuzzer memory limits. Should be larger then |kMaxParseDepth| in
+ // cxfa_fmparser.cpp.
+ const unsigned long kMaxDepth = 5000;
+
static unsigned long depth_;
- static unsigned long max_depth_;
};
#endif // XFA_FXFA_FM2JS_CXFA_FMTOJAVASCRIPTDEPTH_H_