guiyanakuang commented on a change in pull request #941:
URL: https://github.com/apache/orc/pull/941#discussion_r736177522



##########
File path: java/tools/src/java/org/apache/orc/tools/FileDump.java
##########
@@ -470,17 +476,30 @@ private static void recoverFiles(final List<String> 
corruptFiles, final Configur
         List<Long> footerOffsets = new ArrayList<>();
 
         // start reading the data file form top to bottom and record the valid 
footers
-        while (remaining > 0) {
-          int toRead = (int) Math.min(DEFAULT_BLOCK_SIZE, remaining);
-          byte[] data = new byte[toRead];
+        while (remaining > 0 && corruptFileLen > (2L * magicLength)) {

Review comment:
       Yes, because after I modified it, it will move magicLength bytes outside 
the first read, which is to ensure that the internal move will not go out of 
bounds.




-- 
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: dev-unsubscr...@orc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to