diff --git a/SOURCES/fix-missing-error-checking-when-reading-proc-net-dev.patch b/SOURCES/fix-missing-error-checking-when-reading-proc-net-dev.patch new file mode 100644 index 0000000..0303f93 --- /dev/null +++ b/SOURCES/fix-missing-error-checking-when-reading-proc-net-dev.patch @@ -0,0 +1,38 @@ +From f8b0e05c03add3d0bd7736c3e3f81e8eb28bc7c3 Mon Sep 17 00:00:00 2001 +From: David Sommerseth +Date: Fri, 13 Sep 2013 18:54:05 +0200 +Subject: [PATCH] Fix missing error checking when reading /proc/net/dev + +Signed-off-by: David Sommerseth +--- + python-ethtool/ethtool.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/python-ethtool/ethtool.c b/python-ethtool/ethtool.c +index e58d5f9..a471726 100644 +--- a/python-ethtool/ethtool.c ++++ b/python-ethtool/ethtool.c +@@ -80,7 +80,7 @@ static PyObject *get_active_devices(PyObject *self __unused, PyObject *args __un + static PyObject *get_devices(PyObject *self __unused, PyObject *args __unused) + { + char buffer[256]; +- char *ret;; ++ char *ret; + PyObject *list = PyList_New(0); + FILE *fd = fopen(_PATH_PROCNET_DEV, "r"); + +@@ -89,7 +89,13 @@ static PyObject *get_devices(PyObject *self __unused, PyObject *args __unused) + return NULL; + } + /* skip over first two lines */ +- ret = fgets(buffer, 256, fd); ret = fgets(buffer, 256, fd); ++ ret = fgets(buffer, 256, fd); ++ ret = fgets(buffer, 256, fd); ++ if( !ret ) { ++ PyErr_SetString(PyExc_OSError, strerror(errno)); ++ return NULL; ++ } ++ + while (!feof(fd)) { + PyObject *str; + char *name = buffer; diff --git a/SPECS/python-ethtool.spec b/SPECS/python-ethtool.spec index eeb5230..7a2f668 100644 --- a/SPECS/python-ethtool.spec +++ b/SPECS/python-ethtool.spec @@ -4,7 +4,7 @@ Summary: Ethernet settings python bindings Name: python-ethtool Version: 0.8 -Release: 7%{?dist} +Release: 8%{?dist} URL: https://github.com/fedora-python/%{name} Source: https://github.com/fedora-python/%{name}/archive/v%{version}.tar.gz Patch0: python-ethtool-0.6-make-pifconfig-output-all-ipv4-addresses-for-interface.patch @@ -15,6 +15,8 @@ Patch2: python-ethtool-0.8-check-libnl-return-codes.patch # Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1330432 # Fixed upstream: https://github.com/fedora-python/python-ethtool/pull/31/files Patch3: fix-long-interface-names.patch +# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1467845 +Patch4: fix-missing-error-checking-when-reading-proc-net-dev.patch License: GPLv2 Group: System Environment/Libraries @@ -35,6 +37,7 @@ PCI locations. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build %{__python} setup.py build @@ -65,6 +68,10 @@ rm -rf %{buildroot} %endif %changelog +* Tue Dec 18 2018 Lumír Balhar - 0.8-8 +- Fix missing error checking when reading from /proc/net/dev +- Resolves: rhbz#1467845 + * Tue Apr 17 2018 Charalampos Stratakis - 0.8-7 - Fix the URL's to point to the proper upstream repositories Resolves: rhbz#1502393