diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-12-27 18:21:07 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-12-27 18:21:07 +0000 |
commit | 7187ede0636788711d157314ae5b131815515a80 (patch) | |
tree | 775c627300a0c60282f7459ec5e82dbc339a1dd7 /lib/libc/net/getservent.c | |
parent | 3d869b9c34726691683c118cd61329ee5a519a69 (diff) | |
download | FreeBSD-src-7187ede0636788711d157314ae5b131815515a80.zip FreeBSD-src-7187ede0636788711d157314ae5b131815515a80.tar.gz |
Small yet significant tweaks/cleanups:
- getservent:
o put _yp_check() proto under #ifdef YP where it belongs
o local YP buffers should be YPMAXRECORD + 2 bytes long and should
be NUL terminated after copying
- gethostbynis:
o local YP buffer should be YPMAXRECORD + 2 bytes long
- getnetbynis:
o local YP buffer should be YPMAXRECORD + 2 bytes long and should
be NUL terminated after copying
- ether_addr:
o local YP buffers should be YPMAXRECORD + 2 bytes long and should
be NUL terminated after copying (in this case it's BUFSIZ + 2 bytes,
but it happens that BUFSIZ == YPMAXRECORD.
- gethostbydns:
o nuke stray 'return(NULL)' in __dns_getanswer() (harmless but looks silly)
These are 2.2 candidates. I will wait a few days to make sure these don't
break anything and then, if there are no objections, move them to the 2.2
branch.
Diffstat (limited to 'lib/libc/net/getservent.c')
-rw-r--r-- | lib/libc/net/getservent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 78d6df1..cd4449f 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93"; #include <rpcsvc/yp_prot.h> #include <rpcsvc/ypclnt.h> static int serv_stepping_yp = 0; +extern int _yp_check __P(( char ** )); #endif -extern int _yp_check __P(( char ** )); #define MAXALIASES 35 @@ -70,7 +70,7 @@ _getservbyport_yp(line) { char *result; int resultlen; - char buf[YPMAXRECORD]; + char buf[YPMAXRECORD + 2]; int rv; snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp), @@ -116,7 +116,7 @@ _getservbyname_yp(line) { char *result; int resultlen; - char buf[YPMAXRECORD]; + char buf[YPMAXRECORD + 2]; if(!yp_domain) { if(yp_get_default_domain(&yp_domain)) |