iemejia commented on code in PR #3864:
URL: https://github.com/apache/avro/pull/3864#discussion_r3567470800
##########
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:
Fixed — skip_union now throws the same descriptive 'Union branch index N out
of range for M branches' message as 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]