Received: by mail.netbsd.org (Postfix, from userid 605) id F29D984DDA; Sat, 27 Oct 2018 21:44:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 12A9F84DD9 for ; Sat, 27 Oct 2018 21:44:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id TpUyqPgMtvDE for ; Sat, 27 Oct 2018 21:44:54 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id DC33584C8D for ; Sat, 27 Oct 2018 21:44:53 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id CD208FBEE; Sat, 27 Oct 2018 21:44:53 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1540676693278370" MIME-Version: 1.0 Date: Sat, 27 Oct 2018 21:44:53 +0000 From: "David Brownlee" Subject: CVS commit: pkgsrc/sysutils/acpica-utils To: pkgsrc-changes@NetBSD.org Reply-To: abs@netbsd.org X-Mailer: log_accum Message-Id: <20181027214453.CD208FBEE@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1540676693278370 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: abs Date: Sat Oct 27 21:44:53 UTC 2018 Modified Files: pkgsrc/sysutils/acpica-utils: Makefile distinfo pkgsrc/sysutils/acpica-utils/patches: patch-source_include_platform_acnetbsd.h Added Files: pkgsrc/sysutils/acpica-utils/patches: patch-source_compiler_aslanalyze.c patch-source_compiler_aslpredef.c patch-source_compiler_aslwalks.c Log Message: Avoid some sprintf buffer overflows reported by gcc 8. Bump PKGREVISION To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 pkgsrc/sysutils/acpica-utils/Makefile cvs rdiff -u -r1.13 -r1.14 pkgsrc/sysutils/acpica-utils/distinfo cvs rdiff -u -r0 -r1.1 \ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c \ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c \ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c cvs rdiff -u -r1.1 -r1.2 \ pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1540676693278370 Content-Disposition: inline Content-Length: 6727 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/sysutils/acpica-utils/Makefile diff -u pkgsrc/sysutils/acpica-utils/Makefile:1.10 pkgsrc/sysutils/acpica-utils/Makefile:1.11 --- pkgsrc/sysutils/acpica-utils/Makefile:1.10 Fri Oct 14 10:31:12 2016 +++ pkgsrc/sysutils/acpica-utils/Makefile Sat Oct 27 21:44:53 2018 @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.10 2016/10/14 10:31:12 maya Exp $ +# $NetBSD: Makefile,v 1.11 2018/10/27 21:44:53 abs Exp $ # DISTNAME= acpica-unix2-20160930 PKGNAME= ${DISTNAME:S/-unix2-/-utils-/} +PKGREVISION= 1 CATEGORIES= sysutils devel MASTER_SITES= https://acpica.org/sites/acpica/files/ @@ -51,4 +52,10 @@ do-test: # This test is broken too # cd ${WRKSRC}/tests/templates && gmake +.include "../../mk/compiler.mk" + +.if !empty(CC_VERSION:Mgcc-8*) +CFLAGS+= -Wno-error=format-truncation +.endif + .include "../../mk/bsd.pkg.mk" Index: pkgsrc/sysutils/acpica-utils/distinfo diff -u pkgsrc/sysutils/acpica-utils/distinfo:1.13 pkgsrc/sysutils/acpica-utils/distinfo:1.14 --- pkgsrc/sysutils/acpica-utils/distinfo:1.13 Mon Sep 17 13:11:59 2018 +++ pkgsrc/sysutils/acpica-utils/distinfo Sat Oct 27 21:44:53 2018 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.13 2018/09/17 13:11:59 maya Exp $ +$NetBSD: distinfo,v 1.14 2018/10/27 21:44:53 abs Exp $ SHA1 (acpica-unix2-20160930.tar.gz) = 45b1d14454b8986ed56ec81c217694131becbcbf RMD160 (acpica-unix2-20160930.tar.gz) = f58d5cbfe516340f168b8e2090c656097c7964cd @@ -9,5 +9,8 @@ RMD160 (acpitests-unix-20160930.tar.gz) SHA512 (acpitests-unix-20160930.tar.gz) = f982826e01de7a79da543c2ca99dfc9459829a03332841dfe00f45bfc1620bdfa986a5ce4c8bbee2933325c1c526434c04e3601d727fb111f049e71e080a4c71 Size (acpitests-unix-20160930.tar.gz) = 1829886 bytes SHA1 (patch-generate_unix_Makefile.config) = b760ec07afa96902641ff4b979b7764baa39aceb -SHA1 (patch-source_include_platform_acnetbsd.h) = d272a3c84d337c2da44d83b37efb81f83a213a39 +SHA1 (patch-source_compiler_aslanalyze.c) = fae01580943d61dd907bd2835be432258f972f7d +SHA1 (patch-source_compiler_aslpredef.c) = 1d4c9a5fe0ad437f55b0381761ed128624fc220d +SHA1 (patch-source_compiler_aslwalks.c) = 7c18ed4005c383020f94c71a2fc5ee2f768fcb07 +SHA1 (patch-source_include_platform_acnetbsd.h) = 004db064e8ff8c2bc5314d6d506e9da8d281376d SHA1 (patch-source_include_platform_acsolaris.h) = ecc090345a6d259f96923376e65d28c57dceebab Index: pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h diff -u pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h:1.1 pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h:1.2 --- pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h:1.1 Mon Sep 17 13:11:59 2018 +++ pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h Sat Oct 27 21:44:53 2018 @@ -1,3 +1,7 @@ +$NetBSD: patch-source_include_platform_acnetbsd.h,v 1.2 2018/10/27 21:44:53 abs Exp $ + +NetBSD versions prior to 7 lack sem_timedwait() in librt + --- source/include/platform/acnetbsd.h.orig 2015-04-10 17:27:17.000000000 +0200 +++ source/include/platform/acnetbsd.h 2015-12-10 14:15:22.000000000 +0100 @@ -112,4 +112,10 @@ Added files: Index: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c diff -u /dev/null pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c:1.1 --- /dev/null Sat Oct 27 21:44:53 2018 +++ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c Sat Oct 27 21:44:53 2018 @@ -0,0 +1,15 @@ +$NetBSD: patch-source_compiler_aslanalyze.c,v 1.1 2018/10/27 21:44:53 abs Exp $ + +Avoid potential sprintf buffer overflow reported by gcc 8.2.0 + +--- source/compiler/aslanalyze.c.orig 2016-09-30 16:43:56.000000000 +0000 ++++ source/compiler/aslanalyze.c +@@ -355,7 +355,7 @@ AnCheckMethodReturnValue ( + */ + if (ThisNodeBtype != 0) + { +- sprintf (MsgBuffer, ++ snprintf (MsgBuffer, sizeof(MsgBuffer), + "Method returns [%s], %s operator requires [%s]", + StringBuffer, OpInfo->Name, StringBuffer2); + Index: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c diff -u /dev/null pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c:1.1 --- /dev/null Sat Oct 27 21:44:53 2018 +++ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c Sat Oct 27 21:44:53 2018 @@ -0,0 +1,30 @@ +$NetBSD: patch-source_compiler_aslpredef.c,v 1.1 2018/10/27 21:44:53 abs Exp $ + +Avoid potential sprintf buffer overflow reported by gcc 8.2.0 + +--- source/compiler/aslpredef.c.orig 2016-09-30 16:43:57.000000000 +0000 ++++ source/compiler/aslpredef.c +@@ -162,7 +162,7 @@ ApCheckForPredefinedMethod ( + AcpiUtGetExpectedReturnTypes (StringBuffer, + ThisName->Info.ExpectedBtypes); + +- sprintf (MsgBuffer, "%s required for %4.4s", ++ snprintf (MsgBuffer, sizeof(MsgBuffer), "%s required for %4.4s", + StringBuffer, ThisName->Info.Name); + + AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, +@@ -700,12 +700,12 @@ TypeErrorExit: + + if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) + { +- sprintf (MsgBuffer, "%4.4s: found %s, %s required", ++ snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s, %s required", + PredefinedName, TypeName, StringBuffer); + } + else + { +- sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required", ++ snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s at index %u, %s required", + PredefinedName, TypeName, PackageIndex, StringBuffer); + } + Index: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c diff -u /dev/null pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c:1.1 --- /dev/null Sat Oct 27 21:44:53 2018 +++ pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c Sat Oct 27 21:44:53 2018 @@ -0,0 +1,15 @@ +$NetBSD: patch-source_compiler_aslwalks.c,v 1.1 2018/10/27 21:44:53 abs Exp $ + +Avoid potential sprintf buffer overflow reported by gcc 8.2.0 + +--- source/compiler/aslwalks.c.orig 2016-09-30 16:43:57.000000000 +0000 ++++ source/compiler/aslwalks.c +@@ -511,7 +511,7 @@ AnOperandTypecheckWalkEnd ( + AnFormatBtype (StringBuffer, ThisNodeBtype); + AnFormatBtype (StringBuffer2, RequiredBtypes); + +- sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]", ++ snprintf (MsgBuffer, sizeof(MsgBuffer), "[%s] found, %s operator requires [%s]", + StringBuffer, OpInfo->Name, StringBuffer2); + + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, --_----------=_1540676693278370--