krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 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 "net/ftp/ftp_ctrl_response_buffer.h" |
| 6 | #include "net/log/net_log.h" |
| 7 | |
| 8 | // Entry point for LibFuzzer. |
mmoroz | fa449544 | 2015-11-26 14:07:49 | [diff] [blame] | 9 | extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 10 | const net::BoundNetLog log; |
| 11 | net::FtpCtrlResponseBuffer buffer(log); |
| 12 | if (!buffer.ConsumeData(reinterpret_cast<const char*>(data), size)) { |
krasin | f45d529 | 2015-10-22 01:46:22 | [diff] [blame] | 13 | return 0; |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 14 | } |
| 15 | while (buffer.ResponseAvailable()) { |
| 16 | (void)buffer.PopResponse(); |
| 17 | } |
krasin | f45d529 | 2015-10-22 01:46:22 | [diff] [blame] | 18 | return 0; |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 19 | } |