diff options
Diffstat (limited to 'projects/exprtk')
-rw-r--r-- | projects/exprtk/exprtk_fuzzer.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/projects/exprtk/exprtk_fuzzer.cpp b/projects/exprtk/exprtk_fuzzer.cpp index 09c4fc01..3b109138 100644 --- a/projects/exprtk/exprtk_fuzzer.cpp +++ b/projects/exprtk/exprtk_fuzzer.cpp @@ -52,14 +52,19 @@ void run(const std::string& expression_string) if (parser.compile(expression_string, expression)) { - try + const std::size_t max_expression_size = 64 * 1024; + + if (expression_string.size() <= max_expression_size) { - expression.value(); - } - catch (std::runtime_error& rte) - {} + try + { + expression.value(); + } + catch (std::runtime_error& rte) + {} - parser.clear_loop_runtime_check(); + parser.clear_loop_runtime_check(); + } } } |