mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GP-0: Validating extension point suffixes (Closes #6671)
This commit is contained in:
parent
4852a1ca2f
commit
e88fe40a1e
1 changed files with 13 additions and 3 deletions
|
@ -24,8 +24,7 @@ import java.time.Instant;
|
|||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
@ -561,7 +560,18 @@ public class ClassSearcher {
|
|||
for (ResourceFile moduleRoot : moduleRootDirectories) {
|
||||
ResourceFile file = new ResourceFile(moduleRoot, "data/ExtensionPoint.manifest");
|
||||
if (file.exists()) {
|
||||
extensionPointSuffixes.addAll(FileUtilities.getLinesQuietly(file));
|
||||
for (String line : FileUtilities.getLinesQuietly(file)) {
|
||||
line = line.trim();
|
||||
try {
|
||||
Pattern.compile(line);
|
||||
extensionPointSuffixes.add(line);
|
||||
}
|
||||
catch (PatternSyntaxException e) {
|
||||
Msg.error(ClassSearcher.class,
|
||||
"Skipping invalid extension point suffix '%s' found in '%s'"
|
||||
.formatted(line, file));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue