|
16 | 16 |
|
17 | 17 | package org.apache.poi; |
18 | 18 |
|
| 19 | +import java.awt.AWTError; |
19 | 20 | import java.awt.geom.IllegalPathStateException; |
20 | 21 | import java.io.ByteArrayInputStream; |
21 | 22 | import java.io.IOException; |
|
50 | 51 | import org.apache.poi.stress.XWPFFileHandler; |
51 | 52 | import org.apache.poi.util.DocumentFormatException; |
52 | 53 | import org.apache.poi.util.RecordFormatException; |
| 54 | +import org.apache.poi.xssf.binary.XSSFBParseException; |
53 | 55 | import org.apache.xmlbeans.XmlException; |
54 | 56 | import org.junit.platform.commons.util.ExceptionUtils; |
55 | 57 | import org.opentest4j.AssertionFailedError; |
@@ -99,13 +101,18 @@ public static void fuzzerTestOneInput(byte[] input) throws Exception { |
99 | 101 | IllegalArgumentException | IllegalStateException | IndexOutOfBoundsException | NoSuchElementException | |
100 | 102 | UnsupportedOperationException | NegativeArraySizeException | BufferUnderflowException | |
101 | 103 | ChunkNotFoundException | RecordInputStream.LeftoverDataException | RecordFormatException | |
102 | | - OpenXML4JException | OpenXML4JRuntimeException | DocumentFormatException | |
| 104 | + OpenXML4JException | OpenXML4JRuntimeException | DocumentFormatException | XSSFBParseException | |
103 | 105 | // some FileHandlers perform checks via assertions, so we expect this type of exception as well |
104 | 106 | AssertionFailedError | TestAbortedException | |
105 | 107 | NotImplementedException | FormulaParseException | IllegalPathStateException |
106 | 108 | e) { |
107 | 109 | // expected here |
108 | | - } catch (java.lang.InternalError e) { |
| 110 | + } catch (AWTError e) { |
| 111 | + // POI cannot fix it if there is no DISPLAY |
| 112 | + if (!ExceptionUtils.readStackTrace(e).contains("Can't connect to X11 window server")) { |
| 113 | + throw e; |
| 114 | + } |
| 115 | + } catch (InternalError e) { |
109 | 116 | // POI cannot fix it if the font-system is not fully installed, so let's ignore |
110 | 117 | // this for fuzzing |
111 | 118 | if (!ExceptionUtils.readStackTrace(e).contains("Fontconfig head is null")) { |
|
0 commit comments