Fix buffer overflow when adding an user to a group. Thanks to Peter Vrabec.

This commit is contained in:
nekral-guest 2008-02-18 21:36:03 +00:00
parent 280fcebae8
commit ed52b88b92
3 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-02-18 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/groupmems.c: Fix buffer overflow when adding an user
to a group. Thanks to Peter Vrabec.
2008-02-14 Nicolas François <nicolas.francois@centraliens.net> 2008-02-14 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, etc/useradd: Change the default HOME directory in * NEWS, etc/useradd: Change the default HOME directory in

2
NEWS
View File

@ -19,6 +19,8 @@ shadow-4.1.0 -> shadow-4.1.1 UNRELEASED
passwd entry, but no shadow entry. passwd entry, but no shadow entry.
- groupadd - groupadd
* New option -p/--password to specify an encrypted password. * New option -p/--password to specify an encrypted password.
- groupmems
* Fix buffer overflow when adding an user to a group. Thanks to Peter Vrabec.
- groupmod - groupmod
* New option -p/--password to specify an encrypted password. * New option -p/--password to specify an encrypted password.
- grpck - grpck

View File

@ -104,7 +104,7 @@ static void addtogroup (char *user, char **members)
} }
} }
members = (char **) realloc (members, sizeof (char *) * i); members = (char **) realloc (members, sizeof (char *) * (i+2));
members[i] = user; members[i] = user;
members[i + 1] = NULL; members[i + 1] = NULL;
} }