fuzz: Get rid of cpp mess in fuzzers
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
2756eae1c7
Коммит
314c57d414
@ -1,7 +1,7 @@
|
||||
project(fuzzing CXX)
|
||||
|
||||
macro(fuzzer name)
|
||||
add_executable(${name} ${name}.cpp)
|
||||
add_executable(${name} ${name}.c)
|
||||
target_link_libraries(${name}
|
||||
PRIVATE
|
||||
ssh::static)
|
||||
|
@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -52,5 +50,3 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -51,5 +49,3 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define LIBSSH_STATIC 1
|
||||
#include <libssh/libssh.h>
|
||||
@ -83,7 +84,7 @@ static void select_loop(ssh_session session, ssh_channel channel)
|
||||
ssh_event_free(event);
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
ssh_session session = NULL;
|
||||
ssh_channel channel = NULL;
|
@ -24,6 +24,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define LIBSSH_STATIC 1
|
||||
#include <libssh/libssh.h>
|
||||
@ -117,7 +118,7 @@ static int write_rsa_hostkey(const char *rsakey_path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
int socket_fds[2] = {-1, -1};
|
||||
ssize_t nwritten;
|
Загрузка…
Ссылка в новой задаче
Block a user