Tighten string length bounds and propagate invalid jv in implode
Before adoption: this commit came in with the history the project adopted, so no landing records it.
The bound added in CVE-2026-32316 (e47e56d22) still allowed `sizeof(jvp_string) + (currlen + len) * 2 + 1` to wrap `size_t` on 32-bit platforms. Tighten the threshold so the final allocation fits in 32-bit `size_t`. Also break out of `jv_string_implode` and `f_string_implode` once `jv_string_append_codepoint` returns an invalid `jv`; otherwise the next iteration triggers the assertion in `jvp_string_ptr` (or invokes undefined behavior under `-DNDEBUG`). Fixes CVE-2026-54679.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Dirk Müller <dirk@dmllr.de>
Diff stats
2 files+4 added−2 removed
- other:+4 added−2 removed