From owner-svn-src-all@FreeBSD.ORG Mon Oct 6 14:43:03 2014 Return-Path: Delivered-To: svn-src-all@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 CBC2E5D6; Mon, 6 Oct 2014 14:43:03 +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 9D46C641; Mon, 6 Oct 2014 14:43:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s96Eh3UY022722; Mon, 6 Oct 2014 14:43:03 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s96Eh2Jn022718; Mon, 6 Oct 2014 14:43:02 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201410061443.s96Eh2Jn022718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Mon, 6 Oct 2014 14:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272649 - head/contrib/byacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 14:43:03 -0000 Author: rodrigc Date: Mon Oct 6 14:43:02 2014 New Revision: 272649 URL: https://svnweb.freebsd.org/changeset/base/272649 Log: MFV: 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: head/contrib/byacc/CHANGES head/contrib/byacc/defs.h head/contrib/byacc/reader.c Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Mon Oct 6 14:39:45 2014 (r272648) +++ head/contrib/byacc/CHANGES Mon Oct 6 14:43:02 2014 (r272649) @@ -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: head/contrib/byacc/defs.h ============================================================================== --- head/contrib/byacc/defs.h Mon Oct 6 14:39:45 2014 (r272648) +++ head/contrib/byacc/defs.h Mon Oct 6 14:43:02 2014 (r272649) @@ -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: head/contrib/byacc/reader.c ============================================================================== --- head/contrib/byacc/reader.c Mon Oct 6 14:39:45 2014 (r272648) +++ head/contrib/byacc/reader.c Mon Oct 6 14:43:02 2014 (r272649) @@ -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); }