Skip to content

Commit 922fc40

Browse files
authored
Apache poi add missing limits and revert log4j workaround (#12905)
Issue https://issues.oss-fuzz.com/issues/42537716 is caused by a missing lower limit which we adjust for other fuzz-targets already to adjust for the available memory which oss-fuzz uses. This PR applies the limit in two more places and removes a workaround for a version-incompatibility in log4j 2.24.1 and an issue with pom-dependencies in XMLBeans.
1 parent 4c217fb commit 922fc40

File tree

3 files changed

+10
-33
lines changed

3 files changed

+10
-33
lines changed

Diff for: projects/apache-poi/pom.xml

-33
Original file line numberDiff line numberDiff line change
@@ -50,60 +50,27 @@
5050
<groupId>org.apache.poi</groupId>
5151
<artifactId>poi</artifactId>
5252
<version>${fuzzedLibaryVersion}</version>
53-
<!-- these exclusions can be removed again when XmlBeans 5.3.0 is released with fixed bom-dependency
54-
See https://lists.apache.org/thread/tn9j8h94vtftr1r4xg28c43r8okp4hoj -->
55-
<exclusions>
56-
<exclusion>
57-
<groupId>org.apache.logging.log4j</groupId>
58-
<artifactId>log4j-bom</artifactId>
59-
</exclusion>
60-
</exclusions>
6153
</dependency>
6254
<dependency>
6355
<groupId>org.apache.poi</groupId>
6456
<artifactId>poi-ooxml</artifactId>
6557
<version>${fuzzedLibaryVersion}</version>
66-
<exclusions>
67-
<exclusion>
68-
<groupId>org.apache.logging.log4j</groupId>
69-
<artifactId>log4j-bom</artifactId>
70-
</exclusion>
71-
</exclusions>
7258
</dependency>
7359
<dependency>
7460
<groupId>org.apache.poi</groupId>
7561
<artifactId>poi-scratchpad</artifactId>
7662
<version>${fuzzedLibaryVersion}</version>
77-
<exclusions>
78-
<exclusion>
79-
<groupId>org.apache.logging.log4j</groupId>
80-
<artifactId>log4j-bom</artifactId>
81-
</exclusion>
82-
</exclusions>
8363
</dependency>
8464
<dependency>
8565
<groupId>org.apache.poi</groupId>
8666
<artifactId>poi-examples</artifactId>
8767
<version>${fuzzedLibaryVersion}</version>
88-
<exclusions>
89-
<exclusion>
90-
<groupId>org.apache.logging.log4j</groupId>
91-
<artifactId>log4j-bom</artifactId>
92-
</exclusion>
93-
</exclusions>
9468
</dependency>
9569
<dependency>
9670
<groupId>org.apache.logging.log4j</groupId>
9771
<artifactId>log4j-core</artifactId>
9872
<version>2.24.2</version>
9973
</dependency>
100-
<dependency>
101-
<groupId>org.apache.logging.log4j</groupId>
102-
<artifactId>log4j-bom</artifactId>
103-
<version>2.24.2</version>
104-
<type>pom</type>
105-
<scope>import</scope>
106-
</dependency>
10774
</dependencies>
10875

10976
<build>

Diff for: projects/apache-poi/src/main/java/org/apache/poi/EncryptDecryptFuzzer.java

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
3939

4040
public class EncryptDecryptFuzzer {
41+
public static void fuzzerInitialize() {
42+
POIFuzzer.adjustLimits();
43+
}
44+
4145
public static void fuzzerTestOneInput(FuzzedDataProvider data) throws IOException, GeneralSecurityException {
4246
try {
4347
EncryptionMode encryptionMode = EncryptionMode.values()[(data.consumeInt(0, EncryptionMode.values().length - 1))];

Diff for: projects/apache-poi/src/main/java/org/apache/poi/POIFuzzer.java

+6
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@
4949
* It catches all exceptions that are currently expected.
5050
*/
5151
public class POIFuzzer {
52+
public static void fuzzerInitialize() {
53+
adjustLimits();
54+
}
55+
5256
public static void fuzzerTestOneInput(byte[] input) {
5357
// try to invoke various methods which parse documents/workbooks/slide-shows/...
58+
// all of these catch expected exceptions and thus any failure indicates something
59+
// that we should take a look at
5460

5561
fuzzAny(input);
5662

0 commit comments

Comments
 (0)