swebb2066 commented on code in PR #460:
URL: https://github.com/apache/logging-log4cxx/pull/460#discussion_r1929466213


##########
src/fuzzers/cpp/DOMConfiguratorFuzzer.cpp:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#include "stdint.h"
+#include <fuzzer/FuzzedDataProvider.h>
+#include <log4cxx/xml/domconfigurator.h>
+
+using namespace log4cxx;
+using namespace log4cxx::helpers;
+using namespace log4cxx::xml;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+       char filename[9] = "conf.xml";
+
+       FILE *fp = fopen(filename, "wb");
+       if (!fp) {

Review Comment:
   For OSS-fuzz to deeply investigate the DOMConfigurator code, it would need 
to generate mostly valid log4cxx configuration which would be extremely 
unlikely, as admitted by this concluding comment in [this blog 
post](https://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html)
   
   > In practical terms, this means that afl-fuzz won't have as much luck 
"inventing" PNG files or non-trivial HTML documents from scratch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to