blob: e2b7a8ca1e994b3dfdbf34ecefcd2429faa05800 [file] [log] [blame]
// Copyright 2018 The Chromium OS 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 "shill/net/rtnl_handler.h"
#include "shill/net/io_handler.h"
#include <base/at_exit.h>
#include <base/logging.h>
namespace shill {
class RTNLHandlerFuzz {
public:
static void Run(const uint8_t* data, size_t size) {
base::AtExitManager exit_manager;
InputData input(static_cast<const unsigned char*>(data), size);
RTNLHandler::GetInstance()->ParseRTNL(&input);
}
};
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Turn off logging.
logging::SetMinLogLevel(logging::LOG_FATAL);
RTNLHandlerFuzz::Run(data, size);
return 0;
}
} // namespace shill