Sat Oct 27 21:44:53 2018 UTC ()
Avoid some sprintf buffer overflows reported by gcc 8. Bump PKGREVISION


(abs)
diff -r1.10 -r1.11 pkgsrc/sysutils/acpica-utils/Makefile
diff -r1.13 -r1.14 pkgsrc/sysutils/acpica-utils/distinfo
diff -r0 -r1.1 pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c
diff -r0 -r1.1 pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c
diff -r0 -r1.1 pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c
diff -r1.1 -r1.2 pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h

cvs diff -r1.10 -r1.11 pkgsrc/sysutils/acpica-utils/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/acpica-utils/Makefile 2016/10/14 10:31:12 1.10
+++ pkgsrc/sysutils/acpica-utils/Makefile 2018/10/27 21:44:53 1.11
@@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
1# $NetBSD: Makefile,v 1.10 2016/10/14 10:31:12 maya Exp $ 1# $NetBSD: Makefile,v 1.11 2018/10/27 21:44:53 abs Exp $
2# 2#
3 3
4DISTNAME= acpica-unix2-20160930 4DISTNAME= acpica-unix2-20160930
5PKGNAME= ${DISTNAME:S/-unix2-/-utils-/} 5PKGNAME= ${DISTNAME:S/-unix2-/-utils-/}
 6PKGREVISION= 1
6CATEGORIES= sysutils devel 7CATEGORIES= sysutils devel
7MASTER_SITES= https://acpica.org/sites/acpica/files/ 8MASTER_SITES= https://acpica.org/sites/acpica/files/
8 9
9MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://www.acpica.org/ 11HOMEPAGE= http://www.acpica.org/
11COMMENT= Intel ACPI CA Unix utilities 12COMMENT= Intel ACPI CA Unix utilities
12LICENSE= modified-bsd OR gnu-gpl-v2 13LICENSE= modified-bsd OR gnu-gpl-v2
13 14
14TESTS_DISTNAME= ${DISTNAME:S/acpica-unix2-/acpitests-unix-/} 15TESTS_DISTNAME= ${DISTNAME:S/acpica-unix2-/acpitests-unix-/}
15DISTFILES= ${DEFAULT_DISTFILES} 16DISTFILES= ${DEFAULT_DISTFILES}
16DISTFILES+= ${TESTS_DISTNAME}${EXTRACT_SUFX} 17DISTFILES+= ${TESTS_DISTNAME}${EXTRACT_SUFX}
17 18
18USE_TOOLS+= bison flex gm4 gmake bash 19USE_TOOLS+= bison flex gm4 gmake bash
@@ -41,14 +42,20 @@ do-test: @@ -41,14 +42,20 @@ do-test:
41# ACPICA Tests rely on non-zero exit 42# ACPICA Tests rely on non-zero exit
42## ASL tests 43## ASL tests
43 cd ${WRKSRC}/tests && ./aslts.sh -u 44 cd ${WRKSRC}/tests && ./aslts.sh -u
44## API tests 45## API tests
45 cd ${WRKSRC}/tests/aapits && gmake 46 cd ${WRKSRC}/tests/aapits && gmake
46 cd ${WRKSRC}/tests/aapits/asl && \ 47 cd ${WRKSRC}/tests/aapits/asl && \
47 ASL=${WRKSRC}/generate/unix/bin/iasl gmake 48 ASL=${WRKSRC}/generate/unix/bin/iasl gmake
48# This one needs to be fixed 49# This one needs to be fixed
49# cd ${WRKSRC}/tests/aapits/bin && ./aapitsrun 50# cd ${WRKSRC}/tests/aapits/bin && ./aapitsrun
50## Template tests 51## Template tests
51# This test is broken too 52# This test is broken too
52# cd ${WRKSRC}/tests/templates && gmake 53# cd ${WRKSRC}/tests/templates && gmake
53 54
 55.include "../../mk/compiler.mk"
 56
 57.if !empty(CC_VERSION:Mgcc-8*)
 58CFLAGS+= -Wno-error=format-truncation
 59.endif
 60
54.include "../../mk/bsd.pkg.mk" 61.include "../../mk/bsd.pkg.mk"

cvs diff -r1.13 -r1.14 pkgsrc/sysutils/acpica-utils/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/acpica-utils/distinfo 2018/09/17 13:11:59 1.13
+++ pkgsrc/sysutils/acpica-utils/distinfo 2018/10/27 21:44:53 1.14
@@ -1,13 +1,16 @@ @@ -1,13 +1,16 @@
1$NetBSD: distinfo,v 1.13 2018/09/17 13:11:59 maya Exp $ 1$NetBSD: distinfo,v 1.14 2018/10/27 21:44:53 abs Exp $
2 2
3SHA1 (acpica-unix2-20160930.tar.gz) = 45b1d14454b8986ed56ec81c217694131becbcbf 3SHA1 (acpica-unix2-20160930.tar.gz) = 45b1d14454b8986ed56ec81c217694131becbcbf
4RMD160 (acpica-unix2-20160930.tar.gz) = f58d5cbfe516340f168b8e2090c656097c7964cd 4RMD160 (acpica-unix2-20160930.tar.gz) = f58d5cbfe516340f168b8e2090c656097c7964cd
5SHA512 (acpica-unix2-20160930.tar.gz) = 9d3eb7ece52bd62ff5784f7173b7ad5d1140bcb56c8ed4256d7293b0f6d296c5ad600636c26f6fbc0989440839b2e986ae387c65389451538779748d1d932b1a 5SHA512 (acpica-unix2-20160930.tar.gz) = 9d3eb7ece52bd62ff5784f7173b7ad5d1140bcb56c8ed4256d7293b0f6d296c5ad600636c26f6fbc0989440839b2e986ae387c65389451538779748d1d932b1a
6Size (acpica-unix2-20160930.tar.gz) = 1424425 bytes 6Size (acpica-unix2-20160930.tar.gz) = 1424425 bytes
7SHA1 (acpitests-unix-20160930.tar.gz) = 395c3c2103cbf80a5f73ff9cde16d6e1096e4a5d 7SHA1 (acpitests-unix-20160930.tar.gz) = 395c3c2103cbf80a5f73ff9cde16d6e1096e4a5d
8RMD160 (acpitests-unix-20160930.tar.gz) = f9d3e152191c2595301e2356441fca8630c36b0e 8RMD160 (acpitests-unix-20160930.tar.gz) = f9d3e152191c2595301e2356441fca8630c36b0e
9SHA512 (acpitests-unix-20160930.tar.gz) = f982826e01de7a79da543c2ca99dfc9459829a03332841dfe00f45bfc1620bdfa986a5ce4c8bbee2933325c1c526434c04e3601d727fb111f049e71e080a4c71 9SHA512 (acpitests-unix-20160930.tar.gz) = f982826e01de7a79da543c2ca99dfc9459829a03332841dfe00f45bfc1620bdfa986a5ce4c8bbee2933325c1c526434c04e3601d727fb111f049e71e080a4c71
10Size (acpitests-unix-20160930.tar.gz) = 1829886 bytes 10Size (acpitests-unix-20160930.tar.gz) = 1829886 bytes
11SHA1 (patch-generate_unix_Makefile.config) = b760ec07afa96902641ff4b979b7764baa39aceb 11SHA1 (patch-generate_unix_Makefile.config) = b760ec07afa96902641ff4b979b7764baa39aceb
12SHA1 (patch-source_include_platform_acnetbsd.h) = d272a3c84d337c2da44d83b37efb81f83a213a39 12SHA1 (patch-source_compiler_aslanalyze.c) = fae01580943d61dd907bd2835be432258f972f7d
 13SHA1 (patch-source_compiler_aslpredef.c) = 1d4c9a5fe0ad437f55b0381761ed128624fc220d
 14SHA1 (patch-source_compiler_aslwalks.c) = 7c18ed4005c383020f94c71a2fc5ee2f768fcb07
 15SHA1 (patch-source_include_platform_acnetbsd.h) = 004db064e8ff8c2bc5314d6d506e9da8d281376d
13SHA1 (patch-source_include_platform_acsolaris.h) = ecc090345a6d259f96923376e65d28c57dceebab 16SHA1 (patch-source_include_platform_acsolaris.h) = ecc090345a6d259f96923376e65d28c57dceebab

File Added: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c
$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);
 

File Added: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c
$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);
     }
 

File Added: pkgsrc/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c
$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,

cvs diff -r1.1 -r1.2 pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h (expand / switch to unified diff)

--- pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h 2018/09/17 13:11:59 1.1
+++ pkgsrc/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h 2018/10/27 21:44:53 1.2
@@ -1,13 +1,17 @@ @@ -1,13 +1,17 @@
 1$NetBSD: patch-source_include_platform_acnetbsd.h,v 1.2 2018/10/27 21:44:53 abs Exp $
 2
 3NetBSD versions prior to 7 lack sem_timedwait() in librt
 4
1--- source/include/platform/acnetbsd.h.orig 2015-04-10 17:27:17.000000000 +0200 5--- source/include/platform/acnetbsd.h.orig 2015-04-10 17:27:17.000000000 +0200
2+++ source/include/platform/acnetbsd.h 2015-12-10 14:15:22.000000000 +0100 6+++ source/include/platform/acnetbsd.h 2015-12-10 14:15:22.000000000 +0100
3@@ -112,4 +112,10 @@ 7@@ -112,4 +112,10 @@
4 #define ACPI_USE_SYSTEM_CLIBRARY 8 #define ACPI_USE_SYSTEM_CLIBRARY
5 #define ACPI_USE_NATIVE_DIVIDE 9 #define ACPI_USE_NATIVE_DIVIDE
6  10
7+/* NetBSD versions prior to 7 lack sem_timedwait() in librt */ 11+/* NetBSD versions prior to 7 lack sem_timedwait() in librt */
8+#include <sys/param.h> 12+#include <sys/param.h>
9+#if (__NetBSD_Version__ < 700000000) /* NetBSD 7 */ 13+#if (__NetBSD_Version__ < 700000000) /* NetBSD 7 */
10+#define ACPI_USE_ALTERNATE_TIMEOUT 14+#define ACPI_USE_ALTERNATE_TIMEOUT
11+#endif 15+#endif
12+ 16+
13 #endif /* __ACNETBSD_H__ */ 17 #endif /* __ACNETBSD_H__ */