iemejia commented on code in PR #3864:
URL: https://github.com/apache/avro/pull/3864#discussion_r3567491325
##########
lang/perl/lib/Avro/BinaryDecoder.pm:
##########
@@ -323,8 +567,11 @@ sub skip_union {
my $class = shift;
my ($schema, $reader) = @_;
my $idx = decode_long($class, undef, undef, $reader);
- my $union_schema = $schema->schemas->[$idx]
- or throw Avro::Schema::Error::Parse("union union member");
+ my $schemas = $schema->schemas;
+ if ($idx < 0 || $idx >= scalar @$schemas) {
+ throw Avro::Schema::Error::Parse("union union member");
+ }
Review Comment:
Already addressed in commit 58989e7402 — skip_union now throws 'Union branch
index $idx out of range for N branches', matching decode_union.
--
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]