Review report

core: PR #36631

2 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Oversized structured mutations can be truncated mid-record

Near the length limit, byte-level truncation can cut a structured PSBT mutation inside a required record, preventing parsing of later fields.

Location: src/test/fuzz/util/psbt.cpp:478 (head).

Details and suggested fix

Growth mutations can make SerializePSBT(maps) exceed max_size, but the final resize ignores record and map boundaries. The template path has the same problem when the configured maximum length is smaller than the template. If the cut lands inside a required map, deserialization can parse preceding fields but then throws before reaching later maps or successful construction. Cutting only unused trailing maps need not cause rejection. Rather than slicing the structured candidate, fall back before resizing: if (out.size() > max_size) return FuzzDefaultMutate(data, size, max_size);. The original data is still unchanged at that point. The current copy and returned length are bounded; this is a fuzz-mutation quality suggestion, and its effect on coverage has not been measured.


Link

[suggestion] · Map-removal mutation can delete the global map

The count-changing mutation can remove the global map, causing template-derived PSBTs to fail before any input or output map is parsed.

Location: src/test/fuzz/util/psbt.cpp:450 (head).

Details and suggested fix

map_idx ranges over every map, including index zero, and case 5 uses it directly for deletion. Deleting the global map alone from either template promotes its first input map to global. The v0 input map is empty, while the v2 input fields are unknown global types. Neither supplies a global version or unsigned transaction, so parsing defaults to v0 and throws "No unsigned transaction was provided" before reading input or output maps. Draw the erase index from [1, maps.size()) instead. This retains the intended count-shrinking mutation without discarding the global map; malformed containers remain reachable through the existing raw-mutation path. Later mutations in the same call may repair the result, and the overall coverage effect has not been measured.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.