From: Ulrich Drepper Date: Mon, 17 Mar 1997 03:55:56 +0000 (+0000) Subject: (__yp_bind): Fix possible buffer overflow. X-Git-Tag: cvs/glibc-2_0_4~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94f177304113dc1205acd486fa42e4aaddadf1c1;p=thirdparty%2Fglibc.git (__yp_bind): Fix possible buffer overflow. --- diff --git a/nis/ypclnt.c b/nis/ypclnt.c index 6644118ac8c..b128ad63661 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 , 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)