Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: testing/libfuzzer/fuzzers/libxml_xml_regexp_compile_fuzzer.cc

Issue 2788063002: Disable various unused libxml features: catalogs, DocBook, legacy APIs, etc. (Closed)
Patch Set: Remove files from build, remove regexp fuzzer. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 <stddef.h>
6 #include <stdint.h>
7
8 #include <algorithm>
9 #include <string>
10 #include <vector>
11
12 #include "libxml/parser.h"
13 #include "libxml/tree.h"
14 #include "libxml/xmlversion.h"
15
16
17 void ignore (void * ctx, const char * msg, ...) {
18 // Error handler to avoid spam of error messages from libxml parser.
19 }
20
21
22 // Entry point for LibFuzzer.
23 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
24 xmlSetGenericErrorFunc(NULL, &ignore);
25
26 std::vector<uint8_t> buffer(size + 1, 0);
27 std::copy(data, data + size, buffer.data());
28
29 xmlRegexpPtr x = xmlRegexpCompile(buffer.data());
30 if (x)
31 xmlRegFreeRegexp(x);
32
33 return 0;
34 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698