diff --git a/libgtop-add-NULL-pointer-checker.patch b/libgtop-add-NULL-pointer-checker.patch new file mode 100644 index 0000000..d5ed342 --- /dev/null +++ b/libgtop-add-NULL-pointer-checker.patch @@ -0,0 +1,25 @@ +From e0f97e7dbd6ec87103705d3e114876d44cb0ca4c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= +Date: Mon, 1 May 2017 06:31:54 +0200 +Subject: Add NULL pointer checker (bug found with scan-build). + +--- + sysdeps/common/error.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/common/error.c b/sysdeps/common/error.c +index 0502271..6ca947b 100644 +--- a/sysdeps/common/error.c ++++ b/sysdeps/common/error.c +@@ -46,7 +46,7 @@ print_message (const glibtop *server, int message_level, const char *format, int + + g_string_printf(message, "%s", (server && server->name ? server->name : DEFAULT_NAME)); + +- if (server->pid) { ++ if (server && server->pid) { + g_string_append_printf(message, "(c=%u/s=%u)", getpid(), server->pid); + } + else { +-- +cgit v0.12 + diff --git a/libgtop.changes b/libgtop.changes index ee8ca67..0ea6bbb 100644 --- a/libgtop.changes +++ b/libgtop.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue May 23 09:58:38 UTC 2017 - zaitor@opensuse.org + +- Add libgtop-add-NULL-pointer-checker.patch: Add NULL pointer + checker (bug found with scan-build). Patch from upstream stable + git branch. + ------------------------------------------------------------------- Tue Mar 21 09:52:56 UTC 2017 - dimstar@opensuse.org diff --git a/libgtop.spec b/libgtop.spec index d64aafc..5903857 100644 --- a/libgtop.spec +++ b/libgtop.spec @@ -26,6 +26,8 @@ Group: Development/Libraries/C and C++ Url: https://developer.gnome.org/libgtop/stable/ Source: http://download.gnome.org/sources/libgtop/2.36/%{name}-%{version}.tar.xz Source99: baselibs.conf +# PATCH-FIX-UPSTREAM libgtop-add-NULL-pointer-checker.patch zaitor@opensuse.org -- Add NULL pointer checker. +Patch0: libgtop-add-NULL-pointer-checker.patch BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel %if !0%{?is_opensuse} @@ -115,6 +117,7 @@ from /dev/kmem. translation-update-upstream po libgtop # rpmlint note: libgtop has a separate translation for both Bengali and Bengali India %endif +%patch0 -p1 %build %configure\