]> source.dussan.org Git - poi.git/commitdiff
bug 62624 -- fix recursion
authorTim Allison <tallison@apache.org>
Tue, 30 Oct 2018 21:30:57 +0000 (21:30 +0000)
committerTim Allison <tallison@apache.org>
Tue, 30 Oct 2018 21:30:57 +0000 (21:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845284 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/macros/VBAMacroReader.java

index 1a971b7e1bc8996323ca2857f6105369d438383d..4a9f258087cd2c643d503dc99d397f870fa91bef 100644 (file)
@@ -352,13 +352,8 @@ public class VBAMacroReader implements Closeable {
                 DocumentNode document = (DocumentNode)entry;
                 DocumentInputStream dis = new DocumentInputStream(document);
                 readProjectProperties(dis, moduleNameMap, modules);
-            } else {
-                for (Entry child : node) {
-                    if (child instanceof DirectoryNode) {
-                        findProjectProperties((DirectoryNode)child, moduleNameMap, modules);
-                    }
-                }
-
+            } else if (entry instanceof DirectoryNode) {
+                findProjectProperties((DirectoryNode)entry, moduleNameMap, modules);
             }
         }
     }
@@ -369,13 +364,8 @@ public class VBAMacroReader implements Closeable {
                 DocumentNode document = (DocumentNode)entry;
                 DocumentInputStream dis = new DocumentInputStream(document);
                 readNameMapRecords(dis, moduleNameMap, modules.charset);
-            } else {
-                for (Entry child : node) {
-                    if (child instanceof DirectoryNode) {
-                        findModuleNameMap((DirectoryNode)child, moduleNameMap, modules);
-                    }
-                }
-
+            } else if (entry.isDirectoryEntry()) {
+                findModuleNameMap((DirectoryNode)entry, moduleNameMap, modules);
             }
         }
     }