From 773aa4ab3bd77e90afc8ecd46fb156bb9c5f76bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Wed, 9 Nov 2016 13:28:13 +0100
Subject: Fix nlmsgerr length check

---
 ...et-Netlink-0.04-Fix-nlmsgerr-length-check.patch | 41 ++++++++++++++++++++++
 perl-Socket-Netlink.spec                           |  8 ++++-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch

diff --git a/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch 
b/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
new file mode 100644
index 0000000..e554ea2
--- /dev/null
+++ b/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
@@ -0,0 +1,41 @@
+From 01a86755a7d1ac97b1218ffe43ae8d1a8fdc4aab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
+Date: Wed, 9 Nov 2016 10:42:23 +0100
+Subject: [PATCH] Fix nlmsgerr length check
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There was a wrong boolean expression reported by a GCC warning:
+
+lib/Socket/Netlink.xs: In function 'XS_Socket__Netlink_unpack_nlmsgerr':
+lib/Socket/Netlink.xs:195:20: warning: comparison of constant '20ul' with 
boolean expression is always false [-Wbool-compare]
+     if(!SvCUR(msg) == sizeof(nlmsgerr))
+                    ^~
+lib/Socket/Netlink.xs:195:20: warning: logical not is only applied to the left 
hand side of comparison [-Wlogical-not-parentheses]
+
+This patch fixes it.
+
+CPAN RT#118688.
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ lib/Socket/Netlink.xs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Socket/Netlink.xs b/lib/Socket/Netlink.xs
+index 6211b7f..6900819 100644
+--- a/lib/Socket/Netlink.xs
++++ b/lib/Socket/Netlink.xs
+@@ -192,7 +192,7 @@ unpack_nlmsgerr(msg)
+   PPCODE:
+     if(!SvPOK(msg))
+       croak("Expected a string message");
+-    if(!SvCUR(msg) == sizeof(nlmsgerr))
++    if(SvCUR(msg) != sizeof(nlmsgerr))
+       croak("Expected %d bytes of message", sizeof(nlmsgerr));
+ 
+     Copy(SvPVbyte_nolen(msg), &nlmsgerr, sizeof(nlmsgerr), char);
+-- 
+2.7.4
+
diff --git a/perl-Socket-Netlink.spec b/perl-Socket-Netlink.spec
index fc02218..6ed1167 100644
--- a/perl-Socket-Netlink.spec
+++ b/perl-Socket-Netlink.spec
@@ -1,11 +1,13 @@
 Name:           perl-Socket-Netlink
 Version:        0.04
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Interface to Linux's PF_NETLINK socket family
 License:        GPL+ or Artistic
 
 URL:            http://search.cpan.org/dist/Socket-Netlink/
 Source0:        
http://www.cpan.org/authors/id/P/PE/PEVANS/Socket-Netlink-%{version}.tar.gz
+# Fix nlmsgerr length check, CPAN RT#118688
+Patch0:         Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
 
 BuildRequires:  perl-devel
 BuildRequires:  perl-generators
@@ -43,6 +45,7 @@ IO::Socket::Netlink.
 
 %prep
 %setup -q -n Socket-Netlink-%{version}
+%patch0 -p1
 
 
 %build
@@ -69,6 +72,9 @@ IO::Socket::Netlink.
 
 
 %changelog
+* Wed Nov 09 2016 Petr Pisar <ppi...@redhat.com> - 0.04-17
+- Fix nlmsgerr length check (CPAN RT#118688)
+
 * Sun May 15 2016 Jitka Plesnikova <jples...@redhat.com> - 0.04-16
 - Perl 5.24 rebuild
 
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-Socket-Netlink.git/commit/?h=f25&id=773aa4ab3bd77e90afc8ecd46fb156bb9c5f76bb
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to