Fix heap buffer overflow when formatting an empty string
Before adoption: this commit came in with the history the project adopted, so no landing records it.
The `jv_string_empty` did not properly null-terminate the string data, which could lead to a heap buffer overflow. The test case of GHSA-p7rr-28xf-3m5w (`0[""*0]`) was fixed by the commit dc849e9bb74a, but another case (`0[[]|implode]`) was still vulnerable. This commit ensures string data is properly null-terminated, and fixes CVE-2025-48060.
authored by itchyny · committed by itchyny · parent 3b00981 · Browse files · 2 files+5 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+5 added−0 removed
- tests:+4 added−0 removed
- other:+1 added−0 removed