OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 "content/common/set_ipc_fuzzing.h" |
| 6 |
| 7 #if defined(OS_LINUX) |
| 8 #include <dlfcn.h> |
| 9 #endif |
| 10 |
| 11 typedef IPC::SyncChannel::OutgoingMessageFilter *(*GetFuzzerFunction)(); |
| 12 const char kFuzzLibraryName[] = "libipcfuzz.so"; |
| 13 const char kFuzzEntryPointName[] = "GetFilter"; |
| 14 |
| 15 void SetIPCFuzzing(IPC::SyncChannel *channel) { |
| 16 |
| 17 #if defined(OS_LINUX) |
| 18 // Fuzz is currently linux-only feature |
| 19 void *fuzz_library = dlopen(kFuzzLibraryName, RTLD_LAZY); |
| 20 if (fuzz_library) { |
| 21 GetFuzzerFunction fuzz_entry_point = reinterpret_cast<GetFuzzerFunction>( |
| 22 dlsym(fuzz_library, kFuzzEntryPointName)); |
| 23 |
| 24 if (fuzz_entry_point) |
| 25 channel->set_outgoing_message_filter(fuzz_entry_point()); |
| 26 } |
| 27 #endif // OS_LINUX |
| 28 |
| 29 } |
| 30 |
| 31 |
| 32 |
OLD | NEW |