Files
zig/lib/std/json
nash1111 22aa2bd1e7 std.json: honor max_value_len for sentinel strings (#30782)
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>
2026-06-03 14:31:35 +02:00
..
2025-07-19 16:05:01 -07:00