Fix heap buffer overflow when formatting an empty string
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.
I
itchyny committed
c6e041699d8cd31b97375a2596217aff2cfca85b
Parent: 3b00981