Use MAX_UID_T_LEN + 1 for uid/gid buffers, not MAX_UID_T_LEN to
prevent potential truncation. Bug #562.
This commit is contained in:
@@ -687,7 +687,7 @@ void
|
|||||||
rebuild_env(void)
|
rebuild_env(void)
|
||||||
{
|
{
|
||||||
char **old_envp, **ep, *cp, *ps1;
|
char **old_envp, **ep, *cp, *ps1;
|
||||||
char idbuf[MAX_UID_T_LEN];
|
char idbuf[MAX_UID_T_LEN + 1];
|
||||||
unsigned int didvar;
|
unsigned int didvar;
|
||||||
bool reset_home = false;
|
bool reset_home = false;
|
||||||
|
|
||||||
|
@@ -1108,7 +1108,7 @@ static char *
|
|||||||
sudo_ldap_build_pass1(struct passwd *pw)
|
sudo_ldap_build_pass1(struct passwd *pw)
|
||||||
{
|
{
|
||||||
struct group *grp;
|
struct group *grp;
|
||||||
char *buf, timebuffer[TIMEFILTER_LENGTH], gidbuf[MAX_UID_T_LEN];
|
char *buf, timebuffer[TIMEFILTER_LENGTH], gidbuf[MAX_UID_T_LEN + 1];
|
||||||
struct group_list *grlist;
|
struct group_list *grlist;
|
||||||
size_t sz = 0;
|
size_t sz = 0;
|
||||||
int i;
|
int i;
|
||||||
|
Reference in New Issue
Block a user