Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jit: avoid integer wraparound in stack size definition (PCRE2Project#42)
pcre2_jit_stack_create() allows the user to indicate how big of a stack size JIT should be able to allocate and use, using a size_t variable which should be able to hold bigger values than reasonable. Internally, the value is rounded to the next 8K, but if the value is unreasonable large, would overflow and could result in a smaller than expected stack or a maximun size that is smaller than the minimum.. Avoid the overflow by checking the value and failing early, and while at it make the check clearer while documenting the failure mode. Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
- Loading branch information