Don't crash while fuzzing

This commit is contained in:
Joseph C. Lehner 2017-05-15 09:03:55 +02:00
parent aa8ab35a0e
commit 1b27e82a10
2 changed files with 6 additions and 0 deletions

2
nmrp.c
View file

@ -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)

4
tftp.c
View file

@ -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, '/');