Date: Tue, 2 Apr 2002 12:47:41 -0800 (PST) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 8918 for review Message-ID: <200204022047.g32KlfK14950@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=8918 Change 8918 by des@des.at.des.thinksec.com on 2002/04/02 12:47:12 Allocate the correct amount of memory for the environment list (forgot to multiply by sizeof(char *)). Submitted by: Takanori Saneto <sanewo@ba2.so-net.ne.jp> Affected files ... ... //depot/projects/openpam/lib/pam_putenv.c#7 edit Differences ... ==== //depot/projects/openpam/lib/pam_putenv.c#7 (text+ko) ==== @@ -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 <stdlib.h> @@ -73,7 +73,8 @@ /* 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; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204022047.g32KlfK14950>