From c956084b0d7c807f21c93f4a82571496d4bb65b1 Mon Sep 17 00:00:00 2001 From: Tim Allison Date: Tue, 30 Oct 2018 21:30:57 +0000 Subject: [PATCH] bug 62624 -- fix recursion git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845284 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/poifs/macros/VBAMacroReader.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java index 1a971b7e1b..4a9f258087 100644 --- a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java +++ b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java @@ -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); } } }