mirror of git://sourceware.org/git/glibc.git
Update.
* nis/nis_addmember.c (nis_addmember): Add assert to check buffer bounds.
This commit is contained in:
parent
78d8d2117b
commit
faf4346213
|
|
@ -1,5 +1,8 @@
|
||||||
2004-10-24 Ulrich Drepper <drepper@redhat.com>
|
2004-10-24 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nis/nis_addmember.c (nis_addmember): Add assert to check buffer
|
||||||
|
bounds.
|
||||||
|
|
||||||
* resolv/nss_dns/dns-host.c: Avoid using PLTs.
|
* resolv/nss_dns/dns-host.c: Avoid using PLTs.
|
||||||
* include/libc-symbols.h: Define hidden attribute macros for
|
* include/libc-symbols.h: Define hidden attribute macros for
|
||||||
libnss_nisplus and libutil.
|
libnss_nisplus and libutil.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 1997, 1998, 1999 Free Software Foundation, Inc.
|
/* Copyright (c) 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
|
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
|
||||||
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <rpcsvc/nis.h>
|
#include <rpcsvc/nis.h>
|
||||||
|
|
||||||
|
|
@ -71,6 +72,8 @@ nis_addmember (const_nis_name member, const_nis_name group)
|
||||||
}
|
}
|
||||||
++NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len;
|
++NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len;
|
||||||
|
|
||||||
|
/* Check the buffer bounds are not exceeded. */
|
||||||
|
assert (strlen (NIS_RES_OBJECT(res)->zo_name) + 1 < grouplen + 14);
|
||||||
cp = stpcpy (buf, NIS_RES_OBJECT(res)->zo_name);
|
cp = stpcpy (buf, NIS_RES_OBJECT(res)->zo_name);
|
||||||
*cp++ = '.';
|
*cp++ = '.';
|
||||||
strncpy (cp, NIS_RES_OBJECT (res)->zo_domain, NIS_MAXNAMELEN);
|
strncpy (cp, NIS_RES_OBJECT (res)->zo_domain, NIS_MAXNAMELEN);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue