encoding: inconsistent panic behavior for {hex,base32,base64}.Decode #58391
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
CL 461958 introduced inconsistencies across two dimensions:
Encode
still panics on output buffers too small, whileDecode
now treats such cases as an error. This inconsistency cannot be resolved sinceEncode
does not report an error and could be an argument for why we should revert CL 461958.base32
andbase64
packages share very similar API ashex
, and their equivalentDecode
functions still panic if the output buffer is too small. We should handle these cases in identical ways across packages.Should we revert CL 461958 to maintain consistency between
Encode
andDecode
?Or should we roll forward with applying equivalent checks to
base32
andbase64
?I have a very minor preference for rolling back.
Related: the fact that
Encode
andDecode
can panic is a sharp edge fixed by #53693.\cc @bprosnitz @ianlancetaylor @bcmills
The text was updated successfully, but these errors were encountered: