From 5b62060b37853b9d9426478b6d3e15023bfdcdb7 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 12 Feb 1999 04:11:11 +0000 Subject: [PATCH] * sane_hostname.c: Force maxlen to be 16 if it's less than 16, since otherwise a numeric IP address won't fit. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11169 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/ChangeLog | 3 +++ src/util/pty/sane_hostname.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 11e8a5f81..454f09771 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,5 +1,8 @@ Thu Feb 11 22:24:03 1999 Tom Yu + * sane_hostname.c: Force maxlen to be 16 if it's less than 16, + since otherwise a numeric IP address won't fit. + * Makefile.in: Add sane_hostname.{o,c}; bump minor version. * libpty.h: Add prototype for make_sane_hostname. diff --git a/src/util/pty/sane_hostname.c b/src/util/pty/sane_hostname.c index 93871d8d4..6871b3de7 100644 --- a/src/util/pty/sane_hostname.c +++ b/src/util/pty/sane_hostname.c @@ -51,7 +51,8 @@ pty_make_sane_hostname(struct sockaddr_in *addr, *out = NULL; if (maxlen && maxlen < 16) - return -1; /* XXX */ + /* assume they meant 16, otherwise IP addr won't fit */ + maxlen = 16; #ifndef NO_UT_HOST ut_host_len = sizeof (ut.ut_host); #else -- 2.26.2