pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/memtestplus memtestplus: spell arraycount cor...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9c8ae3a92ff2
branches:  trunk
changeset: 374784:9c8ae3a92ff2
user:      maya <maya%pkgsrc.org@localhost>
date:      Mon Jan 29 11:52:10 2018 +0000

description:
memtestplus: spell arraycount correctly and avoid UB.

might help PR pkg/52962: memtestplus doesn't work if built with recent
compilers.

PKGREVISION++

diffstat:

 sysutils/memtestplus/Makefile                   |   4 +-
 sysutils/memtestplus/distinfo                   |   3 +-
 sysutils/memtestplus/patches/patch-controller.c |  43 +++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 3 deletions(-)

diffs (82 lines):

diff -r d6ec7e277879 -r 9c8ae3a92ff2 sysutils/memtestplus/Makefile
--- a/sysutils/memtestplus/Makefile     Mon Jan 29 11:45:34 2018 +0000
+++ b/sysutils/memtestplus/Makefile     Mon Jan 29 11:52:10 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2018/01/15 09:50:47 jperkin Exp $
+# $NetBSD: Makefile,v 1.23 2018/01/29 11:52:10 maya Exp $
 #
 
 # Note -- version number also in the do-install rule
@@ -7,7 +7,7 @@
 
 DISTNAME=              memtest86+-${MAJVER}.${MINVER}
 PKGNAME=               memtestplus-${MAJVER}.${MINVER}
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            sysutils
 MASTER_SITES=          http://www.memtest.org/download/${MAJVER}.${MINVER}/
 
diff -r d6ec7e277879 -r 9c8ae3a92ff2 sysutils/memtestplus/distinfo
--- a/sysutils/memtestplus/distinfo     Mon Jan 29 11:45:34 2018 +0000
+++ b/sysutils/memtestplus/distinfo     Mon Jan 29 11:52:10 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2015/11/04 01:32:21 agc Exp $
+$NetBSD: distinfo,v 1.13 2018/01/29 11:52:10 maya Exp $
 
 SHA1 (memtest86+-5.01.tar.gz) = eb4b6d70114db3c9ed320785da44c0ba8349c10c
 RMD160 (memtest86+-5.01.tar.gz) = 756b57d8f8a3b7408aba0b2fc0cadcdc1df966df
@@ -8,6 +8,7 @@
 SHA1 (patch-ab) = 04ca819d23656c5a73625b457ad730c0cf33e751
 SHA1 (patch-ac) = 9186952e34139b4d4aab6c266a224921a4d39659
 SHA1 (patch-ad) = ab31fec30052fdd3c473ee885ba00d7e3676384f
+SHA1 (patch-controller.c) = 8509599b72f1f11115dc58605b0f438ddfca9b4a
 SHA1 (patch-main.c) = 82e1830d119394f83fa4fd69d492bcc38fe8946f
 SHA1 (patch-makeiso.sh) = 939056a96a1384e4d27772bf5612a755deca8145
 SHA1 (patch-nbstart.S) = d97a6e9c25a57d0f5510c3acf4dccf0f0c0c31b0
diff -r d6ec7e277879 -r 9c8ae3a92ff2 sysutils/memtestplus/patches/patch-controller.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/memtestplus/patches/patch-controller.c   Mon Jan 29 11:52:10 2018 +0000
@@ -0,0 +1,43 @@
+$NetBSD: patch-controller.c,v 1.1 2018/01/29 11:52:10 maya Exp $
+
+Avoid explicit out of bound read (undefined behaviour)
+fix whitespace
+
+--- controller.c.orig  2013-08-10 02:01:58.000000000 +0000
++++ controller.c
+@@ -292,15 +292,15 @@ static void setup_nhm(void)
+ 
+       /* First, locate the PCI bus where the MCH is located */
+ 
+-      for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++      for(i = 0; i < sizeof(possible_nhm_bus)/sizeof(possible_nhm_bus[0]); i++) {
+               pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+               pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+               vid &= 0xFFFF;
+               did &= 0xFF00;
+               if(vid == 0x8086 && did >= 0x2C00) { 
+                       nhm_bus = possible_nhm_bus[i]; 
+-                      }
+-}
++              }
++      }
+ 
+       /* Now, we have the last IMC bus number in nhm_bus */
+       /* Check for ECC & Scrub */
+@@ -327,14 +327,14 @@ static void setup_nhm32(void)
+       ctrl.mode = ECC_NONE;
+ 
+       /* First, locate the PCI bus where the MCH is located */
+-      for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++      for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
+               pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+               pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+               vid &= 0xFFFF;
+               did &= 0xFF00;
+               if(vid == 0x8086 && did >= 0x2C00) { 
+                       nhm_bus = possible_nhm_bus[i]; 
+-                      }
++              }
+       }
+ 
+       /* Now, we have the last IMC bus number in nhm_bus */



Home | Main Index | Thread Index | Old Index