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

Unified Diff: third_party/ots/fuzz/ots_fuzzer.cc

Issue 2008943002: [libfuzzer] Add ots_fuzzer for OpenTypeSanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ots/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/fuzz/ots_fuzzer.cc
diff --git a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc b/third_party/ots/fuzz/ots_fuzzer.cc
similarity index 52%
copy from components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
copy to third_party/ots/fuzz/ots_fuzzer.cc
index 184012299e576afa4f344f2a04c7762e27a78ca3..d52f1b64fd009a53b52ebad2f457c8262b8366ee 100644
--- a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
+++ b/third_party/ots/fuzz/ots_fuzzer.cc
@@ -5,11 +5,15 @@
#include <stddef.h>
#include <stdint.h>
-#include "components/webcrypto/fuzzer_support.h"
+#include "third_party/ots/include/opentype-sanitiser.h"
+#include "third_party/ots/include/ots-memory-stream.h"
+
+static uint8_t buffer[256 * 1024] = { 0 };
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- webcrypto::ImportRsaKeyFromDerFuzzData(data, size,
- blink::WebCryptoKeyFormatPkcs8);
+ ots::OTSContext context;
+ ots::MemoryStream stream(static_cast<void*>(buffer), sizeof(buffer));
+ context.Process(&stream, data, size);
return 0;
}
« no previous file with comments | « third_party/ots/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698