| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "libxml/parser.h" |
| 6 |
| 7 void ignore (void * ctx, const char * msg, ...) { |
| 8 // Error handler to avoid spam of error messages from libxml parser. |
| 9 } |
| 10 |
| 11 extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) { |
| 12 xmlSetGenericErrorFunc(NULL, &ignore); |
| 13 |
| 14 if (auto doc = xmlReadMemory(reinterpret_cast<const char *>(data), |
| 15 size, "noname.xml", NULL, 0)) { |
| 16 xmlFreeDoc(doc); |
| 17 } |
| 18 |
| 19 return 0; |
| 20 } |
| OLD | NEW |