aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-09-18 16:55:17 (EDT)
committerJohn Ross2013-09-19 08:54:29 (EDT)
commit4b7cd47f03accff9f72e4df49584fc4d2df9c658 (patch)
tree5e4ce0d302c6426ddaed3c2b6db288777ac7cf90
parent8aa3f3936553c8e0b3f03a9f5ee23302e42fc614 (diff)
downloadrt.equinox.framework-4b7cd47f03accff9f72e4df49584fc4d2df9c658.zip
rt.equinox.framework-4b7cd47f03accff9f72e4df49584fc4d2df9c658.tar.gz
rt.equinox.framework-4b7cd47f03accff9f72e4df49584fc4d2df9c658.tar.bz2
The possibility of an NPE exists in DirBundleFile.getEntryPaths if all of the following apply. (1) The bundle file contains an empty directory. (2) The given path contains the empty directory. (3) Recursion was requested.
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java
index fa1c338..4527281 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java
@@ -146,8 +146,11 @@ public class DirBundleFile extends BundleFile {
StringBuilder sb = new StringBuilder(dirPath).append(s);
if (BundleFile.secureAction.isDirectory(childFile)) {
sb.append("/"); //$NON-NLS-1$
- if (recurse)
- entries.addAll(Collections.list(getEntryPaths(sb.toString(), true)));
+ if (recurse) {
+ Enumeration<String> e = getEntryPaths(sb.toString(), true);
+ if (e != null)
+ entries.addAll(Collections.list(e));
+ }
}
entries.add(sb.toString());
}