pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/acpica-utils Avoid some sprintf buffer overfl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aef95d3608b2
branches:  trunk
changeset: 386710:aef95d3608b2
user:      abs <abs%pkgsrc.org@localhost>
date:      Sat Oct 27 21:44:53 2018 +0000

description:
Avoid some sprintf buffer overflows reported by gcc 8. Bump PKGREVISION

diffstat:

 sysutils/acpica-utils/Makefile                                         |   9 ++-
 sysutils/acpica-utils/distinfo                                         |   7 +-
 sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c       |  15 +++++
 sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c        |  30 ++++++++++
 sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c         |  15 +++++
 sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h |   4 +
 6 files changed, 77 insertions(+), 3 deletions(-)

diffs (127 lines):

diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/Makefile
--- a/sysutils/acpica-utils/Makefile    Sat Oct 27 21:03:09 2018 +0000
+++ b/sysutils/acpica-utils/Makefile    Sat Oct 27 21:44:53 2018 +0000
@@ -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 @@
 # 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"
diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/distinfo
--- a/sysutils/acpica-utils/distinfo    Sat Oct 27 21:03:09 2018 +0000
+++ b/sysutils/acpica-utils/distinfo    Sat Oct 27 21:44:53 2018 +0000
@@ -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 @@
 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
diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/acpica-utils/patches/patch-source_compiler_aslanalyze.c  Sat Oct 27 21:44:53 2018 +0000
@@ -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);
+ 
diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/acpica-utils/patches/patch-source_compiler_aslpredef.c   Sat Oct 27 21:44:53 2018 +0000
@@ -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);
+     }
+ 
diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/acpica-utils/patches/patch-source_compiler_aslwalks.c    Sat Oct 27 21:44:53 2018 +0000
@@ -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,
diff -r 1c560738825d -r aef95d3608b2 sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h
--- a/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h    Sat Oct 27 21:03:09 2018 +0000
+++ b/sysutils/acpica-utils/patches/patch-source_include_platform_acnetbsd.h    Sat Oct 27 21:44:53 2018 +0000
@@ -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 @@



Home | Main Index | Thread Index | Old Index