Received: from list by lists.gnu.org with archive (Exim 4.71) id 1afV5V-0000CM-1v for mharc-grub-devel@gnu.org; Mon, 14 Mar 2016 12:11:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afV5P-0008UA-Fn for grub-devel@gnu.org; Mon, 14 Mar 2016 12:11:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afV5M-0001LK-0g for grub-devel@gnu.org; Mon, 14 Mar 2016 12:11:15 -0400 Received: from mail-bn1on0138.outbound.protection.outlook.com ([157.56.110.138]:41913 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afV5L-0001LA-QQ for grub-devel@gnu.org; Mon, 14 Mar 2016 12:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifesize.onmicrosoft.com; s=selector1-lifesize-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7vFMQ801gTNcrUZSkwQVwTmtuhaF+N67qkuG9XeDqz4=; b=Bt+RmXriWHF2x3TpSRm74PxydYQJBUWCvOYBlKKpvx0QQLS6MnRoNJvyyTbzG7xs5kgzvBvcNkFaTyP1aERTXvTI4iTRIfXkmr/8q0PAciB2dWJbndVM1KEbGf1veNPum2SNetYxk9QrBr2Kle18pFpuf1CDFN5mvWrpkQrF2hQ= Received: from BLUPR15MB0420.namprd15.prod.outlook.com (10.163.214.153) by BLUPR15MB0418.namprd15.prod.outlook.com (10.163.214.151) with Microsoft SMTP Server (TLS) id 15.1.434.16; Mon, 14 Mar 2016 14:37:12 +0000 Received: from BLUPR15MB0420.namprd15.prod.outlook.com ([10.163.214.153]) by BLUPR15MB0420.namprd15.prod.outlook.com ([10.163.214.153]) with mapi id 15.01.0434.016; Mon, 14 Mar 2016 14:37:12 +0000 From: Aaron Luft To: "grub-devel@gnu.org" Subject: 2.02-beta3 remove attempt to free stack space and initialize variable before possible use Thread-Topic: 2.02-beta3 remove attempt to free stack space and initialize variable before possible use Thread-Index: AQHRff7+yYnNa1c1U0qeqlvTQFIaGw== Date: Mon, 14 Mar 2016 14:37:11 +0000 Message-ID: <37E3C737-047D-4F32-9A09-CC2F154C45DF@lifesize.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gnu.org; dkim=none (message not signed) header.d=none; gnu.org; dmarc=none action=none header.from=lifesize.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [73.209.56.21] x-ms-office365-filtering-correlation-id: a2133ea6-323d-4d31-1e3e-08d34c162141 x-microsoft-exchange-diagnostics: 1; BLUPR15MB0418; 5:PDy+gm+JcO6HupqwH57m+8mRNhVObfYIVZmCJvJekqHgbnwBaAxl8TOZqh5UIaL2Ae9qFducSZGkgG/B8fCVW5Wu1jy5PhkpmV8LFs36dFfU97L89XuHYk4wyyxerWDx0U/YuE71SEbNfPboqPdlZQ==; 24:U+5scOoTH88RCgyxHJA79l1QgwRGte5SIykXsAnzewUNIAt5pec4l4m9mUb/VnphZBdR4X9HP9lDTuRGZYAJK/1ZloFijp3UkvYIIwty0D0= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR15MB0418; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR15MB0418; BCL:0; PCL:0; RULEID:; SRVR:BLUPR15MB0418; x-forefront-prvs: 0881A7A935 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377424004)(33656002)(99286002)(2501003)(83716003)(86362001)(66066001)(87936001)(106116001)(1096002)(450100001)(122556002)(81166005)(2900100001)(50986999)(77096005)(54356999)(10400500002)(586003)(5004730100002)(3660700001)(3280700002)(2906002)(102836003)(1220700001)(3846002)(6116002)(5002640100001)(110136002)(107886002)(92566002)(5008740100001)(189998001)(11100500001)(36756003)(82746002)(229853001)(19580395003)(2351001)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR15MB0418; H:BLUPR15MB0420.namprd15.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <841482D546D7CA47B37E7858CFDF8F31@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: lifesize.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2016 14:37:11.7622 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1d8e6215-577d-492c-9fe9-b3c9e7d65fdd X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR15MB0418 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.110.138 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:11:20 -0000 Please consider these improvements to 2.02-beta3. 1) Remove the variable "oldname" which is attempting to free stack space. 2) Initialize the value of mdnobj to silence the compiler warning In function 'grub_free', inlined from 'grub_iso9660_iterate_dir' at grub-core/fs/iso9660.c:764:1= 5: grub-core/kern/emu/mm.c:53:3: error: attempt to free a non-heap object 'nam= e' [-Werror=3Dfree-nonheap-object] free (ptr); ^ lto1: all warnings being treated as errors lto-wrapper: fatal error: x86_64-linux-gnu-gcc-5.3.0 returned 1 exit status grub-core/fs/zfs/zfsinfo.c: In function 'grub_cmd_zfs_bootfs': grub-core/fs/zfs/zfsinfo.c:401:10: error: 'mdnobj' may be used uninitialize= d in this function [-Werror=3Dmaybe-uninitialized] bootfs =3D grub_xasprintf ("zfs-bootfs=3D%s/%llu%s%s%s%s%s%s", ^ grub-core/fs/zfs/zfsinfo.c:355:17: note: 'mdnobj' was declared here grub_uint64_t mdnobj; ^ lto1: all warnings being treated as errors diff -Naur grub-2.02-beta3.orig/grub-core/fs/iso9660.c grub-2.02-beta3/grub= -core/fs/iso9660.c --- grub-2.02-beta3.orig/grub-core/fs/iso9660.c 2016-02-28 02:07:41.0000000= 00 +0000 +++ grub-2.02-beta3/grub-core/fs/iso9660.c 2016-03-12 01:17:26.5811128= 09 +0000 @@ -750,19 +750,15 @@ if (dir->data->joliet && !ctx.filename) { - char *oldname, *semicolon; + char *semicolon; - oldname =3D name; ctx.filename =3D grub_iso9660_convert_string - ((grub_uint8_t *) oldname, dirent.namelen >> 1); + ((grub_uint8_t *) name, dirent.namelen >> 1); semicolon =3D grub_strrchr (ctx.filename, ';'); if (semicolon) *semicolon =3D '\0'; - if (ctx.filename_alloc) - grub_free (oldname); - ctx.filename_alloc =3D 1; } diff -Naur grub-2.02-beta3.orig/grub-core/fs/zfs/zfsinfo.c grub-2.02-beta3/= grub-core/fs/zfs/zfsinfo.c --- grub-2.02-beta3.orig/grub-core/fs/zfs/zfsinfo.c 2016-02-28 02:07:41= .000000000 +0000 +++ grub-2.02-beta3/grub-core/fs/zfs/zfsinfo.c 2016-03-12 01:18:00.5049619= 50 +0000 @@ -352,7 +352,7 @@ char *fsname; char *bootfs; char *poolname; - grub_uint64_t mdnobj; + grub_uint64_t mdnobj =3D 0; if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"))= ;