!3 libpciaccess: update to v0.16 version

Merge pull request !3 from liuzhiqiang/master
This commit is contained in:
openeuler-ci-bot 2020-07-16 16:38:30 +08:00 committed by Gitee
commit ac8208f2e2
4 changed files with 5 additions and 38 deletions

View File

@ -1,35 +0,0 @@
From 44f3dd08f99ba67e967980daaea2b800c68e2659 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 24 Oct 2018 10:11:49 +0200
Subject: [PATCH 1/3] linux: Set number of devices to 0 in case of error
pci_sys is a global variable which is populated on init, and in case of
error reading sysfs on Linux, the devices are NULL, but the number of
devices is left unchanged.
As a result, we may crash in `pci_device_next()` which relies on the
number of devices.
To fix the issue, simply reset the number of devices to zero in case of
error so we don't try to access indices of a NULL array later on.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
src/linux_sysfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index a8bc2e1..e74ad72 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -264,6 +264,7 @@ populate_entries( struct pci_system * p )
if (err) {
free(p->devices);
p->devices = NULL;
+ p->num_devices = 0;
}
return err;
--
2.19.1

Binary file not shown.

BIN
libpciaccess-0.16.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: libpciaccess Name: libpciaccess
Version: 0.14 Version: 0.16
Release: 4 Release: 1
Summary: Generic PCI access library Summary: Generic PCI access library
License: MIT License: MIT
URL: https://www.x.org/ URL: https://www.x.org/
@ -10,7 +10,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Patch0: 0000-libpciaccess-rom-size.patch Patch0: 0000-libpciaccess-rom-size.patch
Patch1: 0001-linux-Set-number-of-devices-to-0-in-case-of-error.patch
BuildRequires: autoconf automake libtool pkgconfig git xorg-x11-util-macros BuildRequires: autoconf automake libtool pkgconfig git xorg-x11-util-macros
Requires: hwdata Requires: hwdata
@ -55,6 +54,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
%changelog %changelog
* Wed Jul 15 2020 Zhiqiang Liu <lzhq28@mail.ustc.edu.cn> - 0.16-1
- update to v0.16 version
* Wed Jul 1 2020 Wu Bo <wubo009@163.com> - 0.14-2.4 * Wed Jul 1 2020 Wu Bo <wubo009@163.com> - 0.14-2.4
- rebuild package - rebuild package