The regcomp and regexec functions in the GNU C Library version 2.3 to version 2.44 may read freed memory and free the same heap block twice when a…
The regcomp and regexec functions in the GNU C Library version 2.3 to version 2.44 may read freed memory and free the same heap block twice when a memory allocation fails while a regular expression is compiled or matched. The re_dfa_add_node (the NFA node table) and build_range_exp (bracket ranges) grow several arrays with consecutive realloc calls and store the new pointers only after all of them succeed. When a later call fails, the pattern buffer keeps pointers to blocks that were already freed, and the error cleanup frees them again. In regexec, the back-reference cache (match_ctx_add_entry) frees its array when a realloc fails but keeps the pointer, which is freed again on the error pat
Read at NIST National Vulnerability Database (CVE API 2.0)
- Vendor
- The GNU C Library
- Product
- glibc
- CVSS v3.1
- 3.7 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
- Weakness
- CWE-415
- Exposure class
- Operating system
- NVD status
- Received
Why it ranks 11 (Routine)
- Product class: operating system
- Recency: items published within 24 hours gain 15, within 72 hours 6, within 7 days 2.