]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__yp_bind): Fix possible buffer overflow.
authorUlrich Drepper <drepper@redhat.com>
Mon, 17 Mar 1997 03:55:56 +0000 (03:55 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 17 Mar 1997 03:55:56 +0000 (03:55 +0000)
nis/ypclnt.c

index 6644118ac8cc0e74d8786c7898da61c4bf1bc327..b128ad63661f6da94c71e4fcb38a782b0e36266e 100644 (file)
@@ -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)