This is an automated email from the ASF dual-hosted git repository.

centic9 pushed a commit to branch improve_fuzzing_and_avoid_some_npes
in repository https://gitbox.apache.org/repos/asf/poi.git

commit 09f05aad52dd85f366161e9b7c2b9db92953114c
Author: Dominik Stadler <[email protected]>
AuthorDate: Tue Oct 27 10:57:51 2026 +0100

    Fuzzing: Add logj4.xml to silence all logs during fuzzing
    
    Many logs are triggered by invalid input on purpose during fuzzing.
    Needs to exclude log4j2-test.xml as it would be preferred.
    
    Also exclude some other unneded files from the shadow-jar
---
 poi-fuzz/build.gradle                  |  9 +++++++++
 poi-fuzz/src/main/resources/log4j2.xml | 24 ++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/poi-fuzz/build.gradle b/poi-fuzz/build.gradle
index 1bd43a730e..3d4c760bcc 100644
--- a/poi-fuzz/build.gradle
+++ b/poi-fuzz/build.gradle
@@ -79,6 +79,15 @@ tasks.register('getFuzzDeps', Copy) {
 shadowJar{
     // set name to not include the version in the file-name
     archiveFileName = "poi-fuzz-all.jar"
+
+    // log4j2-test.xml would take precedence over log4j2.xml, so keep it out
+    exclude 'log4j2-test.xml'
+
+    // remove some native code that is not needed for now
+    exclude 'aix/**'
+    exclude 'darwin/**'
+    exclude 'freebsd/**'
+    exclude 'win/**'
 }
 
 idea {
diff --git a/poi-fuzz/src/main/resources/log4j2.xml 
b/poi-fuzz/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..0f658c0223
--- /dev/null
+++ b/poi-fuzz/src/main/resources/log4j2.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<Configuration status="warn">
+       <Loggers>
+               <Root level="off"/>
+       </Loggers>
+</Configuration>
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to