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>
* 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.
- groupadd
* 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
* New option -p/--password to specify an encrypted password.
- 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 + 1] = NULL;
}