2005-03-19  Bruno Haible  <bruno@clisp.org>
	* intl/dcigettext.c (struct known_translation_t): Change type of
	domainname field to 'const char *'.
	(DCIGETTEXT): Remove const-cast.

	[BZ #661]
	* grp/initgroups.c (internal_getgrouplist): Check if we have
	enough space before adding the primary group to the list.
This commit is contained in:
Roland McGrath 2005-03-29 23:41:03 +00:00
parent edc8cc2a29
commit edac424073
3 changed files with 21 additions and 7 deletions

View File

@ -1,5 +1,15 @@
2005-03-19 Bruno Haible <bruno@clisp.org>
* intl/dcigettext.c (struct known_translation_t): Change type of
domainname field to 'const char *'.
(DCIGETTEXT): Remove const-cast.
2005-03-29 Thorsten Kukuk <kukuk@suse.de> 2005-03-29 Thorsten Kukuk <kukuk@suse.de>
[BZ #661]
* grp/initgroups.c (internal_getgrouplist): Check if we have
enough space before adding the primary group to the list.
* posix/tst-execle1.c (do_test): Fix execle arguments. * posix/tst-execle1.c (do_test): Fix execle arguments.
* posix/tst-execle2.c (do_test): Likewise. * posix/tst-execle2.c (do_test): Likewise.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1989,91,93,1996-2003, 2004 Free Software Foundation, Inc. /* Copyright (C) 1989,91,93,1996-2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -73,7 +73,9 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
/* Start is one, because we have the first group as parameter. */ /* Start is one, because we have the first group as parameter. */
long int start = 1; long int start = 1;
(*groupsp)[0] = group; /* Never store more than the starting *SIZE number of elements. */
if (*size > 0)
(*groupsp)[0] = group;
if (__nss_group_database != NULL) if (__nss_group_database != NULL)
{ {

View File

@ -177,7 +177,7 @@ static void *mempcpy PARAMS ((void *dest, const void *src, size_t n));
struct known_translation_t struct known_translation_t
{ {
/* Domain in which to search. */ /* Domain in which to search. */
char *domainname; const char *domainname;
/* The category. */ /* The category. */
int category; int category;
@ -436,7 +436,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
search = (struct known_translation_t *) search = (struct known_translation_t *)
alloca (offsetof (struct known_translation_t, msgid) + msgid_len); alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
memcpy (search->msgid, msgid1, msgid_len); memcpy (search->msgid, msgid1, msgid_len);
search->domainname = (char *) domainname; search->domainname = domainname;
search->category = category; search->category = category;
/* Since tfind/tsearch manage a balanced tree, concurrent tfind and /* Since tfind/tsearch manage a balanced tree, concurrent tfind and
@ -632,9 +632,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
+ msgid_len + domainname_len + 1); + msgid_len + domainname_len + 1);
if (newp != NULL) if (newp != NULL)
{ {
newp->domainname = char *new_domainname;
mempcpy (newp->msgid, msgid1, msgid_len);
memcpy (newp->domainname, domainname, domainname_len + 1); new_domainname = mempcpy (newp->msgid, msgid1, msgid_len);
memcpy (new_domainname, domainname, domainname_len + 1);
newp->domainname = new_domainname;
newp->category = category; newp->category = category;
newp->counter = _nl_msg_cat_cntr; newp->counter = _nl_msg_cat_cntr;
newp->domain = domain; newp->domain = domain;