Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 20706 Details for
Bug 33383
glibc vulnerabilities
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
glibc-2.3.1-getgrouplist.patch
glibc-getgrouplist.patch (text/plain), 1.64 KB, created by
SpanKY
on 2003-11-13 10:10:37 UTC
(
hide
)
Description:
glibc-2.3.1-getgrouplist.patch
Filename:
MIME Type:
Creator:
SpanKY
Created:
2003-11-13 10:10:37 UTC
Size:
1.64 KB
patch
obsolete
>2003-04-23 Ulrich Drepper <drepper@redhat.com> > > * grp/initgroups.c (getgrouplist): Don't copy too much into the > user buffer if more groups are found than fit into it. > >--- libc/grp/initgroups.c 13 Mar 2002 17:51:09 -0000 1.28 >+++ libc/grp/initgroups.c 23 Apr 2003 21:26:34 -0000 1.29 >@@ -23,6 +23,7 @@ > #include <stdlib.h> > #include <string.h> > #include <unistd.h> >+#include <sys/param.h> > #include <sys/types.h> > #include <nsswitch.h> > >@@ -207,6 +208,9 @@ getgrouplist (const char *user, gid_t gr > return -1; > > result = internal_getgrouplist (user, group, &size, &newgroups, -1); >+ >+ memcpy (groups, newgroups, MIN (*ngroups, result) * sizeof (gid_t)); >+ > if (result > *ngroups) > { > *ngroups = result; >@@ -215,8 +219,6 @@ getgrouplist (const char *user, gid_t gr > else > *ngroups = result; > >- memcpy (groups, newgroups, *ngroups * sizeof (gid_t)); >- > free (newgroups); > return result; > } > >============ >testcase: > >#include <grp.h> >#include <stdlib.h> > >int main (void) >{ > int ngroups = 2, old_ngroups; > gid_t *groups = (gid_t *) malloc ((ngroups + 1) * sizeof (gid_t)); > > if (groups == NULL) > abort (); > groups[ngroups] = (gid_t) 0xdeadbeef; > old_ngroups = ngroups; > if (getgrouplist ("bin", 0, groups, &ngroups) < 0) > { > if (groups[old_ngroups] != (gid_t) 0xdeadbeef) > abort (); > groups = realloc (groups, (ngroups + 1) * sizeof (gid_t)); > if (groups == NULL) > abort (); > groups[ngroups] = (gid_t) 0xdeadbeef; > old_ngroups = ngroups; > if (getgrouplist ("bin", 0, groups, &ngroups) < 0) > abort (); > if (groups[old_ngroups] != (gid_t) 0xdeadbeef) > abort (); > } > else > abort (); > exit (0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33383
:
20704
| 20706 |
20751