From 7ca517bc656c2bf7403284f3b17155ffcae44089 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 2 Apr 2002 20:57:22 +0000 Subject: [PATCH] Fix incorrect allocation size (perforce change 8918) PR: bin/36658 Submitted by: Takanori Saneto --- contrib/openpam/lib/pam_putenv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/openpam/lib/pam_putenv.c b/contrib/openpam/lib/pam_putenv.c index 0d683cfa7c92..3dd996c0f390 100644 --- a/contrib/openpam/lib/pam_putenv.c +++ b/contrib/openpam/lib/pam_putenv.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/openpam/lib/pam_putenv.c#6 $ + * $P4: //depot/projects/openpam/lib/pam_putenv.c#7 $ */ #include @@ -73,7 +73,8 @@ pam_putenv(pam_handle_t *pamh, /* grow the environment list if necessary */ if (pamh->env_count == pamh->env_size) { - env = realloc(pamh->env, pamh->env_size * 2 + 1); + env = realloc(pamh->env, + sizeof(char *) * (pamh->env_size * 2 + 1)); if (env == NULL) return (PAM_BUF_ERR); pamh->env = env;