From 408f62f37367abe8b9574ce183bbb3224b1090be1cfea80fb9815f117ca83beb Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 6 Jul 2017 10:57:50 +0000 Subject: [PATCH] - decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch: Fix recommended by upstream. - Update the URL. - Remove authors list from package description, it does not belong there. OBS-URL: https://build.opensuse.org/package/show/Base:System/i2c-tools?expand=0&rev=40 --- ...ly-check-for-out-of-bounds-vendor-id.patch | 27 +++++++++++++++++++ i2c-tools.changes | 13 +++++++++ i2c-tools.spec | 13 +++------ 3 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch diff --git a/decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch b/decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch new file mode 100644 index 0000000..5e7e92d --- /dev/null +++ b/decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch @@ -0,0 +1,27 @@ +From: Jean Delvare +Date: Thu, 23 Jun 2016 18:59:07 +0200 +Subject: decode-dimms: Correctly check for out-of-bounds vendor ID +Upstream: yes +Git-commit: 2b4135907c1aa27edeb397e62b67386ff5d7d3d5 + +--- + eeprom/decode-dimms | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- i2c-tools-3.1.2.orig/eeprom/decode-dimms 2017-07-06 12:55:49.998319548 +0200 ++++ i2c-tools-3.1.2/eeprom/decode-dimms 2017-07-06 12:55:51.398337567 +0200 +@@ -343,9 +343,11 @@ sub manufacturer_ddr3($$) + { + my ($count, $code) = @_; + return "Invalid" if parity($count) != 1; +- return "Invalid" if parity($code) != 1; +- return (($code & 0x7F) - 1 > $vendors[$count & 0x7F]) ? "Unknown" : +- $vendors[$count & 0x7F][($code & 0x7F) - 1]; ++ return "Invalid" if parity($code) != 1 ++ or ($code & 0x7F) == 0; ++ return "Unknown" if ($count & 0x7F) >= @vendors ++ or ($code & 0x7F) - 1 >= @{$vendors[$count & 0x7F]}; ++ return $vendors[$count & 0x7F][($code & 0x7F) - 1]; + } + + sub manufacturer(@) diff --git a/i2c-tools.changes b/i2c-tools.changes index 31eca1f..54e1c22 100644 --- a/i2c-tools.changes +++ b/i2c-tools.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Jul 6 10:57:08 UTC 2017 - jdelvare@suse.com + +- decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch: + Fix recommended by upstream. + +------------------------------------------------------------------- +Thu Jul 6 10:45:42 UTC 2017 - jdelvare@suse.com + +- Update the URL. +- Remove authors list from package description, it does not belong + there. + ------------------------------------------------------------------- Thu Jul 6 08:16:44 UTC 2017 - jdelvare@suse.com diff --git a/i2c-tools.spec b/i2c-tools.spec index e9d3d5b..2b1eac8 100644 --- a/i2c-tools.spec +++ b/i2c-tools.spec @@ -17,7 +17,6 @@ Name: i2c-tools -Url: http://www.lm-sensors.org/wiki/I2CTools Version: 3.1.2 Release: 0 Summary: A heterogeneous set of I2C tools for Linux @@ -25,12 +24,14 @@ License: GPL-2.0+ Group: Development/Tools/Other Requires: udev Recommends: modules +Url: https://i2c.wiki.kernel.org/index.php/I2C_Tools Source0: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.xz Source1: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.sign Patch90: i2c-tools-hackweek-9-dependencies.diff Patch91: i2c-tools-hackweek-9-improve-DDR3-support.diff Patch92: i2c-tools-r6053-Add-smbus-header.patch Patch93: i2c-tools-r6048-Move-SMBus-helper-functions.patch +Patch94: decode-dimms-correctly-check-for-out-of-bounds-vendor-id.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: s390 s390x @@ -39,21 +40,13 @@ This package contains a heterogeneous set of I2C tools for Linux: a bus probing tool, a chip dumper, register-level access helpers, EEPROM decoding scripts, and more. - - -Authors: --------- - Frodo Looijaard - Philip Edelbrock - Mark Studebaker - Jean Delvare - %prep %setup -q %patch90 -p1 %patch91 -p1 %patch92 -p1 %patch93 -p1 +%patch94 -p1 %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" CC="%{__cc}"