mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-06-21 16:11:50 -04:00
22aa2bd1e7
Fixes `std.json` so `ParseOptions.max_value_len` is honored when parsing sentinel-terminated strings that require allocation/copying. Previously, the sentinel string path used `allocNextIntoArrayList`, which did not use the caller-provided `max_value_len`. This meant sentinel-terminated string parsing did not consistently follow the same allocation limit behavior as other allocating string paths. `max_value_len` is an allocation/copy limit, not a general limit on the length of returned values. Values that can be returned as references to the input buffer, or parsed without intermediate allocation, are not limited by it. Fixes #30579 Verified with: ```sh zig test lib/std/std.zig --zig-lib-dir lib --test-filter max_value_len ``` Co-authored-by: nash1111 <nash1111@users.noreply.github.com> Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30782 Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>