From owner-svn-src-stable@FreeBSD.ORG Sat Oct 11 19:28:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3000DA9D; Sat, 11 Oct 2014 19:28:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0306ADC8; Sat, 11 Oct 2014 19:28:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9BJSN4w040398; Sat, 11 Oct 2014 19:28:23 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9BJSNLs040395; Sat, 11 Oct 2014 19:28:23 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201410111928.s9BJSNLs040395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 11 Oct 2014 19:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272954 - stable/10/contrib/byacc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2014 19:28:24 -0000 Author: rodrigc Date: Sat Oct 11 19:28:22 2014 New Revision: 272954 URL: https://svnweb.freebsd.org/changeset/base/272954 Log: Merge: r272649 use calloc in get_line() when allocating line to ensure it is fully initialized, fixes a later uninitialized value in copy_param() (FreeBSD #193499). PR: 193499 Submitted by: Thomas E. Dickey Modified: stable/10/contrib/byacc/CHANGES stable/10/contrib/byacc/defs.h stable/10/contrib/byacc/reader.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/byacc/CHANGES ============================================================================== --- stable/10/contrib/byacc/CHANGES Sat Oct 11 19:18:00 2014 (r272953) +++ stable/10/contrib/byacc/CHANGES Sat Oct 11 19:28:22 2014 (r272954) @@ -1,3 +1,9 @@ +2014-10-02 Thomas E. Dickey + + * reader.c, defs.h: + use calloc in get_line() when allocating line to ensure it is fully initialized, + fixes a later uninitialized value in copy_param() (FreeBSD #193499). + 2014-07-15 Thomas E. Dickey * aclocal.m4: resync with my-autoconf (no change to configure script) Modified: stable/10/contrib/byacc/defs.h ============================================================================== --- stable/10/contrib/byacc/defs.h Sat Oct 11 19:18:00 2014 (r272953) +++ stable/10/contrib/byacc/defs.h Sat Oct 11 19:28:22 2014 (r272954) @@ -157,6 +157,7 @@ #define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n))) #define FREE(x) (free((char*)(x))) #define MALLOC(n) (malloc((size_t)(n))) +#define TCMALLOC(t,n) ((t*) calloc((size_t)(n), sizeof(t))) #define TMALLOC(t,n) ((t*) malloc((size_t)(n) * sizeof(t))) #define NEW(t) ((t*)allocate(sizeof(t))) #define NEW2(n,t) ((t*)allocate(((size_t)(n)*sizeof(t)))) Modified: stable/10/contrib/byacc/reader.c ============================================================================== --- stable/10/contrib/byacc/reader.c Sat Oct 11 19:18:00 2014 (r272953) +++ stable/10/contrib/byacc/reader.c Sat Oct 11 19:28:22 2014 (r272954) @@ -125,7 +125,7 @@ get_line(void) if (line) FREE(line); linesize = LINESIZE + 1; - line = TMALLOC(char, linesize); + line = TCMALLOC(char, linesize); NO_SPACE(line); }