about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-17 03:55:56 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-17 03:55:56 +0000
commit94f177304113dc1205acd486fa42e4aaddadf1c1 (patch)
tree7c70423133338282e391e8133fc2a6e36f2843bc
parent77055d99e4fc6d319fa746d8730e5c6a484202e5 (diff)
downloadglibc-94f177304113dc1205acd486fa42e4aaddadf1c1.tar.gz
glibc-94f177304113dc1205acd486fa42e4aaddadf1c1.tar.xz
glibc-94f177304113dc1205acd486fa42e4aaddadf1c1.zip
(__yp_bind): Fix possible buffer overflow.
-rw-r--r--nis/ypclnt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 6644118ac8..b128ad6366 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -167,7 +167,8 @@ __yp_bind (const char *domain, dom_binding ** ypdb)
                   ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr,
                   sizeof (ysd->dom_server_addr.sin_addr.s_addr));
           ysd->dom_vers = YPVERS;
-          strcpy (ysd->dom_domain, domain);
+          strncpy (ysd->dom_domain, domain, YPMAXDOMAIN);
+	  ysd->dom_domain[YPMAXDOMAIN] = '\0';
         }
 
       if (ysd->dom_client)