iemejia commented on code in PR #3864:
URL: https://github.com/apache/avro/pull/3864#discussion_r3566894317
##########
lang/perl/lib/Avro/BinaryDecoder.pm:
##########
@@ -350,7 +559,13 @@ sub decode_union {
sub skip_fixed {
my $class = shift;
my ($schema, $reader) = @_;
- $reader->seek($schema->size, 0);
+ # Skip the fixed-size payload relative to the current position (SEEK_CUR);
+ # whence 0 (SEEK_SET) would incorrectly seek to the absolute offset. A
+ # failed seek is treated as fatal.
+ unless ($reader->seek($schema->size, 1)) {
+ throw Avro::Schema::Error::Parse(
+ "Failed to skip " . $schema->size . " bytes");
+ }
Review Comment:
Fixed in d53c40ef69: skip_fixed now calls _ensure_available($reader,
$schema->size) before seeking, mirroring skip_bytes, so a fixed that exceeds
the bytes remaining is rejected on a size-reporting reader instead of silently
seeking past EOF.
--
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]