From 1b27e82a105d7a130dcd2a36f903ca0377a0b041 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Mon, 15 May 2017 09:03:55 +0200 Subject: [PATCH] Don't crash while fuzzing --- nmrp.c | 2 ++ tftp.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/nmrp.c b/nmrp.c index a25a78a..4501d63 100644 --- a/nmrp.c +++ b/nmrp.c @@ -235,6 +235,8 @@ static void msg_mkconfack(struct nmrp_msg *msg, uint32_t ipaddr, uint32_t ipmask #define ethsock_recv(sock, buf, len) read(STDIN_FILENO, buf, len) #define ethsock_send(a, b, c) (0) #define ethsock_set_timeout(a, b) (0) +#define ethsock_arp_add(a, b, c, d) (0) +#define ethsock_arp_del(a, b) (0) #define ethsock_ip_add(a, b, c, d) (0) #define ethsock_ip_del(a, b) (0) #define ethsock_close(a) (0) diff --git a/tftp.c b/tftp.c index bf74650..5189cbf 100644 --- a/tftp.c +++ b/tftp.c @@ -273,6 +273,10 @@ static ssize_t tftp_sendto(int sock, char *pkt, size_t len, const char *leafname(const char *path) { + if (!path) { + return NULL; + } + const char *slash, *bslash; slash = strrchr(path, '/'); -- 2.25.1