Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/libexec/tftpd Pull up revision 1.20 (requested by itojun):



details:   https://anonhg.NetBSD.org/src/rev/b0e92d407262
branches:  netbsd-1-5
changeset: 490614:b0e92d407262
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 03 21:05:52 2001 +0000

description:
Pull up revision 1.20 (requested by itojun):
  Handle getnameinfo error properly.

diffstat:

 libexec/tftpd/tftpd.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 2bcb222c3ff1 -r b0e92d407262 libexec/tftpd/tftpd.c
--- a/libexec/tftpd/tftpd.c     Sat Feb 03 21:03:31 2001 +0000
+++ b/libexec/tftpd/tftpd.c     Sat Feb 03 21:05:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tftpd.c,v 1.18 1999/07/12 20:17:09 itojun Exp $        */
+/*     $NetBSD: tftpd.c,v 1.18.8.1 2001/02/03 21:05:52 he Exp $        */
 
 /*
  * Copyright (c) 1983, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)tftpd.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tftpd.c,v 1.18 1999/07/12 20:17:09 itojun Exp $");
+__RCSID("$NetBSD: tftpd.c,v 1.18.8.1 2001/02/03 21:05:52 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -800,6 +800,7 @@
 {
        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;
 }



Home | Main Index | Thread Index | Old Index