From 761ac7f2da2fd5fd96c5eac8199f55150b0d6350 Mon Sep 17 00:00:00 2001
From: Jacob Gilbert <mrjacobagilbert@gmail.com>
Date: Wed, 7 Feb 2018 18:44:43 -0800
Subject: pmt: fix for error in pmt::equal() when comparing uniform vectors

---
 gnuradio-runtime/lib/pmt/pmt.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'gnuradio-runtime/lib/pmt/pmt.cc')

diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc
index 3b92481549..6c37fa9fd2 100644
--- a/gnuradio-runtime/lib/pmt/pmt.cc
+++ b/gnuradio-runtime/lib/pmt/pmt.cc
@@ -1163,7 +1163,7 @@ equal(const pmt_t& x, const pmt_t& y)
 	       len_x) == 0)
       return true;
 
-    return true;
+    return false;
   }
 
   // FIXME add other cases here...
-- 
cgit v1.2.3


From bdc28a843125a8cab4638c0f19ea136845ff9c74 Mon Sep 17 00:00:00 2001
From: Andrej Rode <mail@andrejro.de>
Date: Thu, 8 Feb 2018 11:53:17 +0100
Subject: pmt: extract lengths before memcmp #1598

---
 gnuradio-runtime/lib/pmt/pmt.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'gnuradio-runtime/lib/pmt/pmt.cc')

diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc
index 6c37fa9fd2..0fe4dbde8e 100644
--- a/gnuradio-runtime/lib/pmt/pmt.cc
+++ b/gnuradio-runtime/lib/pmt/pmt.cc
@@ -1158,9 +1158,9 @@ equal(const pmt_t& x, const pmt_t& y)
       return false;
 
     size_t len_x, len_y;
-    if (memcmp(xv->uniform_elements(len_x),
-	       yv->uniform_elements(len_y),
-	       len_x) == 0)
+    const void *x_m = xv->uniform_elements(len_x);
+    const void *y_m = yv->uniform_elements(len_y);
+    if (memcmp(x_m, y_m, len_x) == 0)
       return true;
 
     return false;
-- 
cgit v1.2.3