Skip to content

Commit

Permalink
fix: skip files that attempt to break filesystem (#3238)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Jul 30, 2023
1 parent 6630888 commit 81d6040
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions brut.j.dir/src/main/java/brut/directory/DirUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import brut.util.BrutIO;
import brut.util.OS;
import java.io.*;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.util.logging.Logger;

Expand Down Expand Up @@ -96,9 +97,11 @@ public static void copyToDir(Directory in, File out, String fileName)
BrutIO.copyAndClose(in.getFileInput(fileName), Files.newOutputStream(outFile.toPath()));
}
}
} catch (RootUnknownFileException | InvalidUnknownFileException | TraversalUnknownFileException exception) {
} catch (FileSystemException exception) {
LOGGER.warning(String.format("Skipping file %s (%s)", fileName, exception.getReason()));
} catch (RootUnknownFileException | InvalidUnknownFileException | TraversalUnknownFileException | IOException exception) {
LOGGER.warning(String.format("Skipping file %s (%s)", fileName, exception.getMessage()));
} catch (IOException | BrutException ex) {
} catch (BrutException ex) {
throw new DirectoryException("Error copying file: " + fileName, ex);
}
}
Expand Down

0 comments on commit 81d6040

Please sign in to comment.