steveloughran commented on code in PR #16500:
URL: https://github.com/apache/iceberg/pull/16500#discussion_r3528877741
##########
core/src/main/java/org/apache/iceberg/DVUtil.java:
##########
@@ -64,6 +65,35 @@ static PositionDeleteIndex readDV(DeleteFile deleteFile,
FileIO fileIO) {
}
}
+ /**
+ * Validates that the deletion-vector offset and length on a {@link
DeleteFile} are well-formed
+ * before they are consumed by a reader. Hostile or corrupted manifest
metadata may otherwise
+ * trigger a {@link NegativeArraySizeException}, an invalid seek, or a
multi-gigabyte allocation
+ * when the DV blob is read.
+ */
+ public static void validateDV(DeleteFile dv) {
+ Preconditions.checkArgument(
Review Comment:
makes sense. the factoring of the construction works though, really makes
clear what it is that you have set.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]