iemejia commented on code in PR #3864:
URL: https://github.com/apache/avro/pull/3864#discussion_r3565240030


##########
lang/perl/lib/Avro/BinaryDecoder.pm:
##########
@@ -132,10 +132,109 @@ sub decode_bytes {
     my $class = shift;
     my $reader = pop;
     my $size = decode_long($class, undef, undef, $reader);
+    if ($size < 0) {
+        throw Avro::Schema::Error::Parse(
+            "Invalid negative bytes/string length: $size");
+    }
+    _ensure_available($reader, $size);
     $reader->read(my $buf, $size);

Review Comment:
   Fixed in fa8332b: decode_bytes now verifies read() returned exactly the 
declared number of bytes (rejecting truncated input), and skip_bytes (used by 
skip_string during resolution) rejects a negative declared length.



-- 
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