summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>2000-11-21 13:39:07 +0000
committeritojun <itojun@NetBSD.org>2000-11-21 13:39:07 +0000
commit9b1ccfd10e4c051bb8d11a0506bb200076717639 (patch)
treee699275a6161fee680577d4a672d7f5d428e4d62 /libexec
parent20494c8f05f9432cc86931c59184f58cecdb8eeb (diff)
handle getnameinfo error properly
Diffstat (limited to 'libexec')
-rw-r--r--libexec/tftpd/tftpd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 4e16b7839cf..f1e5f745eca 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tftpd.c,v 1.19 2000/10/18 01:35:46 dogcow Exp $ */
+/* $NetBSD: tftpd.c,v 1.20 2000/11/21 13:39:07 itojun Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tftpd.c,v 1.19 2000/10/18 01:35:46 dogcow Exp $");
+__RCSID("$NetBSD: tftpd.c,v 1.20 2000/11/21 13:39:07 itojun Exp $");
#endif
#endif /* not lint */
@@ -800,6 +800,7 @@ verifyhost(fromp)
{
static char hbuf[MAXHOSTNAMELEN];
- getnameinfo(fromp, fromp->sa_len, hbuf, sizeof(hbuf), NULL, 0, 0);
+ if (getnameinfo(fromp, fromp->sa_len, hbuf, sizeof(hbuf), NULL, 0, 0))
+ strlcpy(hbuf, "?", sizeof(hbuf));
return hbuf;
}