Skip to content

Commit 7a35580

Browse files
author
Johannes Spaeth
committed
Adding output
1 parent a88d302 commit 7a35580

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/de/codeshield/log4jshell/Log4JProcessDetector.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,20 @@ public static void main(String[] args) throws IOException {
4646
String cpArgs = outputLine.substring(i + searchStr.length() + 1);
4747

4848
// scan for jar files
49-
String[] cpArgsSplit = cpArgs.split(File.pathSeparator + "");
49+
String[] cpArgsSplit = cpArgs.split(File.pathSeparator);
5050
final List<String> foundJarsOnCp =
5151
Arrays.stream(cpArgsSplit)
5252
.map(x -> StringUtils.substring(x, 0, StringUtils.indexOf(x, ".jar") + 4))
5353
.collect(Collectors.toList());
5454

5555
for (String jarFile : foundJarsOnCp) {
56-
Log4JDetector detector = new Log4JDetector();
57-
detector.run(args[0]);
56+
try {
57+
Log4JDetector detector = new Log4JDetector();
58+
System.out.println("Scanning jar file " + jarFile);
59+
// detector.run(jarFile);
60+
} catch (Exception e){
61+
System.out.println("Could not scan jar file " + jarFile);
62+
}
5863
}
5964

6065
} else {

0 commit comments

Comments
 (0)