@@ -2126,7 +2126,9 @@ impl RowPacker<'_> {
21262126 // Map keys must be unique and strictly ascending; iterating a
21272127 // map that violates this trips a debug_assert. A crafted
21282128 // proto can, so reject it as a decode error here instead.
2129- if let Some ( prev) = prev_key && e. key . as_str ( ) <= prev {
2129+ if let Some ( prev) = prev_key
2130+ && e. key . as_str ( ) <= prev
2131+ {
21302132 return Err ( format ! (
21312133 "dict keys must be unique and in ascending order, \
21322134 but {:?} came after {:?}",
@@ -2148,9 +2150,9 @@ impl RowPacker<'_> {
21482150 // represented as variants of ProtoDatumOther.
21492151 //
21502152 // `decPackedToNumber` (called via `Decimal::from_packed_bcd`)
2151- // doesn't bounds-check its input and segfaults on empty bcd —
2152- // reachable from untrusted proto bytes, so we reject before
2153- // descending into the FFI.
2153+ // doesn't bounds-check its input and segfaults on empty bcd.
2154+ // That is reachable from untrusted proto bytes, so we reject
2155+ // before descending into the FFI.
21542156 if x. bcd . is_empty ( ) {
21552157 return Err ( "ProtoNumeric.bcd is empty" . to_string ( ) ) ;
21562158 }
@@ -2170,9 +2172,10 @@ impl RowPacker<'_> {
21702172 upper,
21712173 } = & * * inner;
21722174
2173- // Range bounds must not be `Datum::Null` — `push_range_with`
2174- // panics on that invariant. Reject untrusted proto bytes
2175- // that would push a `Null` bound before calling it.
2175+ // Range bounds must not be `Datum::Null`, because
2176+ // `push_range_with` panics on that invariant. Reject
2177+ // untrusted proto bytes that would push a `Null` bound
2178+ // before calling it.
21762179 let is_null_proto = |d : & ProtoDatum | {
21772180 matches ! (
21782181 d. datum_type,
@@ -2282,7 +2285,7 @@ mod tests {
22822285 #[ mz_ore:: test]
22832286 fn proto_row_invalid_range_is_error ( ) {
22842287 // A ProtoRow with a range whose bounds have inconsistent datum kinds
2285- // (or a null/extra bound) must decode to an error, not panic — the range
2288+ // (or a null/extra bound) must decode to an error, not panic. The range
22862289 // packer used to `assert!` these invariants. Regression for the
22872290 // row_proto_roundtrip cargo-fuzz finding.
22882291 use prost:: Message ;
@@ -2301,7 +2304,7 @@ mod tests {
23012304 #[ mz_ore:: test]
23022305 fn proto_row_unordered_dict_keys_is_error ( ) {
23032306 // A ProtoRow with a dict whose keys are duplicated or not in ascending
2304- // order must decode to an error, not panic — iterating such a map trips
2307+ // order must decode to an error, not panic. Iterating such a map trips
23052308 // a debug_assert. Regression for the row_proto_roundtrip cargo-fuzz
23062309 // finding.
23072310 use prost:: Message ;
0 commit comments