diff options
author | kris <kris@FreeBSD.org> | 1999-12-05 21:02:41 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 1999-12-05 21:02:41 +0000 |
commit | 7edfaee15b155222780370eb09c0447bc58ee9c7 (patch) | |
tree | ba91c1e027ddb610e173f5c64ad677da9d14d6c9 /lib/libc/yp | |
parent | ba067815745dcddc5f556fd408eaa83650a83677 (diff) | |
download | FreeBSD-src-7edfaee15b155222780370eb09c0447bc58ee9c7.zip FreeBSD-src-7edfaee15b155222780370eb09c0447bc58ee9c7.tar.gz |
Fix buffer overflows.
Reviewed by: imp, audit@freebsd.org
Diffstat (limited to 'lib/libc/yp')
-rw-r--r-- | lib/libc/yp/yplib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 0622be1..f5f348b 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -372,7 +372,7 @@ again: ysd->dom_client = NULL; ysd->dom_socket = -1; } - sprintf(path, "%s/%s.%d", BINDINGDIR, dom, 2); + snprintf(path, sizeof(path), "%s/%s.%d", BINDINGDIR, dom, 2); if( (fd=open(path, O_RDONLY)) == -1) { /* no binding file, YP is dead. */ /* Try to bring it back to life. */ @@ -503,7 +503,7 @@ skipit: *(u_short *)&ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port; gotit: ysd->dom_vers = YPVERS; - strcpy(ysd->dom_domain, dom); + strlcpy(ysd->dom_domain, dom, sizeof(ysd->dom_domain)); } /* Don't rebuild the connection to the server unless we have to. */ |