martin-g commented on code in PR #640:
URL: https://github.com/apache/avro-rs/pull/640#discussion_r3861303681


##########
avro/src/schema/parser.rs:
##########
@@ -772,6 +772,11 @@ impl Parser {
                 .ok_or_else(|| 
Details::GetFixedSizeFieldPositive(size.clone())),
             None => Err(Details::GetFixedSizeField),
         }?;
+        // A fixed schema's size directs decoders to allocate that many bytes,
+        // and the schema itself may be attacker-supplied (e.g. an OCF header).
+        // Always bound it before allocating.
+        let size = usize::try_from(size).map_err(|e| 
Details::ConvertU64ToUsize(e, size))?;
+        let size = safe_len(size)?;

Review Comment:
   Agreed!
   Reverted the check!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to