Since 05aafb2 (Implement pcre2_set_max_pattern_compiled_length() and set this limit in the fuzzer, 2024-04-24), the memory modifier has reported the full size of the allocated "code" returned by pcre2_compile.
Problem is that the size of the structure used to hold that in memory also depends on the platform ABI and even alignment by the compiler, and has been therefore fragile to compare.
Revert to reporting only the additional memory that pcre2_compile() will use for the compiled pattern (including any data tables) and make sure that the limit provided with pcre2_set_max_pattern_compiled_length() also avoid the internal struct overhead.
Since 05aafb2 (Implement pcre2_set_max_pattern_compiled_length() and set this limit in the fuzzer, 2024-04-24), the memory modifier has reported the full size of the allocated "code" returned by
pcre2_compile
.Problem is that the size of the structure used to hold that in memory also depends on the platform ABI and even alignment by the compiler, and has been therefore fragile to compare.
Revert to reporting only the additional memory that
pcre2_compile()
will use for the compiled pattern (including any data tables) and make sure that the limit provided withpcre2_set_max_pattern_compiled_length()
also avoid the internal struct overhead.Fixes: #415