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. |
krasin | f45d529 | 2015-10-22 01:46:22 | [diff] [blame] | 9 | extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, |
| 10 | unsigned long size) { |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 11 | const net::BoundNetLog log; |
| 12 | net::FtpCtrlResponseBuffer buffer(log); |
| 13 | if (!buffer.ConsumeData(reinterpret_cast<const char*>(data), size)) { |
krasin | f45d529 | 2015-10-22 01:46:22 | [diff] [blame] | 14 | return 0; |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 15 | } |
| 16 | while (buffer.ResponseAvailable()) { |
| 17 | (void)buffer.PopResponse(); |
| 18 | } |
krasin | f45d529 | 2015-10-22 01:46:22 | [diff] [blame] | 19 | return 0; |
krasin | 89ae30be | 2015-10-21 01:37:43 | [diff] [blame] | 20 | } |