aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi
diff options
context:
space:
mode:
authorTim Allison <tallison@apache.org>2018-10-30 13:25:20 +0000
committerTim Allison <tallison@apache.org>2018-10-30 13:25:20 +0000
commit5ecbaf556343c3d1fb9d70eda5a27e6a62afab36 (patch)
treeeb8dd67c86fe104213fbbb2b59d05034db25356d /src/testcases/org/apache/poi
parent993bb632f90ac8267490fc5cd9241212890fbe5f (diff)
downloadpoi-5ecbaf556343c3d1fb9d70eda5a27e6a62afab36.tar.gz
poi-5ecbaf556343c3d1fb9d70eda5a27e6a62afab36.zip
bug 62625 -- add special handling for REFERENCE_NAME record that may only
contain an ascii string, against the spec in VBAMacroReader git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845238 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi')
-rw-r--r--src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
index 673f82e64f..c6853f156c 100644
--- a/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
+++ b/src/testcases/org/apache/poi/poifs/macros/TestVBAMacroReader.java
@@ -300,4 +300,21 @@ public class TestVBAMacroReader {
assertEquals(Module.ModuleType.Module, macros.get("M\u00F3dulo1").geModuleType());
r.close();
}
+
+ @Test
+ public void bug62625() throws IOException {
+ //macro comes from Common Crawl: 4BZ22N5QG5R2SUU2MNN47PO7VBQLNYIQ
+ //A REFERENCE_NAME can sometimes only have an ascii string without
+ //a reserved byte followed by the unicode string.
+ //See https://github.com/decalage2/oletools/blob/master/oletools/olevba.py#L1516
+ //and https://github.com/decalage2/oletools/pull/135 from (@c1fe)
+
+
+ File f = POIDataSamples.getSpreadSheetInstance().getFile("62625.bin");
+ VBAMacroReader r = new VBAMacroReader(f);
+
+ Map<String, Module> macros = r.readMacroModules();
+ assertEquals(20, macros.size());
+ r.close();
+ }
}