From 725183b5bac23a909b2ebe6f8267f77a7dd1357b Mon Sep 17 00:00:00 2001 From: hpa Date: Wed, 23 Oct 2002 20:47:23 +0000 Subject: [PATCH] Check that the received address is really AF_INET. --- tftpd/tftpd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 5915eaf..052a450 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -543,6 +543,11 @@ main(int argc, char **argv) } } + if ( from.sin_family != AF_INET ) { + syslog(LOG_ERR, "received address was not AF_INET, please check your inetd config"); + exit(EX_PROTOCOL); + } + if ( standalone && myaddr.sin_addr.s_addr == INADDR_ANY ) { /* myrecvfrom() didn't capture the source address; but we might have bound to a specific address, if so we should use it */