Chromium Code Reviews| Index: device/u2f/u2f_message_fuzzer.cc |
| diff --git a/device/u2f/u2f_message_fuzzer.cc b/device/u2f/u2f_message_fuzzer.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..aecc614616ebf1e4315f5cde049b0c344973a6d6 |
| --- /dev/null |
| +++ b/device/u2f/u2f_message_fuzzer.cc |
| @@ -0,0 +1,16 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include <stddef.h> |
| +#include <stdint.h> |
| +#include "u2f_message.h" |
| + |
| +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| + scoped_refptr<net::IOBufferWithSize> buf = |
| + make_scoped_refptr(new net::IOBufferWithSize(size)); |
|
Reilly Grant (use Gerrit)
2016/12/10 00:02:44
scoped_refptr<net::IOBufferWithSize> buf(
new
Casey Piper
2016/12/10 01:38:03
Done.
|
| + memcpy(buf->data(), data, size); |
| + scoped_refptr<device::U2fMessage> msg = |
| + device::U2fMessage::CreateFromSerializedData(buf); |
| + return 0; |
| +} |