From 9024d41d64627fd6a59b5ad66987e11e2d228f16 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 8 Oct 2018 12:43:03 +1100 Subject: [PATCH] Fix integer overflow leading to bad memory access in regex execution Fixes #2481 Fixes #2480 --- src/regex_impl.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 9e87f2c1..77b674f5 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -620,9 +620,9 @@ private: } std::unique_ptr m_data = nullptr; - int16_t m_capacity = 0; - int16_t m_current = 0; - int16_t m_next = 0; + int32_t m_capacity = 0; // Maximum capacity should be 2*instruction count, so 65536 + int32_t m_current = 0; + int32_t m_next = 0; }; DualThreadStack m_threads;