]> granicus.if.org Git - sudo/commitdiff
Use MAX_UID_T_LEN + 1 for uid/gid buffers, not MAX_UID_T_LEN to
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 27 Jun 2012 17:41:58 +0000 (13:41 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 27 Jun 2012 17:41:58 +0000 (13:41 -0400)
prevent potential truncation.  Bug #562.

plugins/sudoers/env.c
plugins/sudoers/ldap.c

index 9b043b282eb756d7a76e9912119a30e03a13da06..a5ceb8c4573e7c3d6e11d83b42c6fdc52edd5fe0 100644 (file)
@@ -687,7 +687,7 @@ void
 rebuild_env(void)
 {
     char **old_envp, **ep, *cp, *ps1;
-    char idbuf[MAX_UID_T_LEN];
+    char idbuf[MAX_UID_T_LEN + 1];
     unsigned int didvar;
     bool reset_home = false;
 
index a2055390aebadaafd1163e6d5a3c31615e7a5646..fd7cdf89ac3dcb8227ac497a4a87bc4202f7da75 100644 (file)
@@ -1108,7 +1108,7 @@ static char *
 sudo_ldap_build_pass1(struct passwd *pw)
 {
     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;
     size_t sz = 0;
     int i;