Add patch to fix crash (bz#1332486)

This commit is contained in:
Terje Røsten 2016-05-18 18:20:46 +02:00
parent a6710141f9
commit 1f3a87e120
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
index ced891a..e89ff93 100644
--- a/src/core/dmi.cc
+++ b/src/core/dmi.cc
@@ -1833,6 +1833,8 @@ static bool scan_dmi_sysfs(hwNode & n)
ifstream ep_stream(SYSFSDMI "/smbios_entry_point",
ifstream::in | ifstream::binary | ifstream::ate);
ifstream::pos_type ep_len = ep_stream.tellg();
+ if (ep_len == -1)
+ return false;
vector < u8 > ep_buf(ep_len);
ep_stream.seekg(0, ifstream::beg);
ep_stream.read((char *)ep_buf.data(), ep_len);

View File

@ -1,7 +1,7 @@
Summary: Hardware lister
Name: lshw
Version: B.02.18
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Group: Applications/System
URL: http://ezix.org/project/wiki/HardwareLiSter
@ -9,6 +9,7 @@ Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz
Source1: lshw.desktop
Source2: org.ezix.lshw.gui.policy
Source3: lshw-gui
Patch1: lshw-B.02.18-non-root.patch
Requires: hwdata
%description
lshw is a small tool to provide detailed informaton on the hardware
@ -33,6 +34,7 @@ format.
%prep
%setup -q
%patch01 -p1
%build
make %{?_smp_mflags} SBINDIR="%{_sbindir}" RPM_OPT_FLAGS="%{optflags}" gui
@ -101,6 +103,9 @@ rm -rf %{buildroot}%{_datadir}/locale/fr/
%{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy
%changelog
* Wed May 18 2016 Terje Rosten <terje.rosten@ntnu.no> - B.02.18-3
- Add patch to fix crash (bz#1332486)
* Mon Apr 25 2016 Terje Rosten <terje.rosten@ntnu.no> - B.02.18-2
- Date fix