From: Joseph C. Lehner Date: Mon, 15 May 2017 07:03:55 +0000 (+0200) Subject: Don't crash while fuzzing X-Git-Tag: v0.9.13~7 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1b27e82a105d7a130dcd2a36f903ca0377a0b041;p=oweals%2Fnmrpflash.git Don't crash while fuzzing --- 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, '/');