Hello community,

here is the log from the commit of package efivar for openSUSE:Factory checked 
in at 2019-03-12 09:47:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/efivar (Old)
 and      /work/SRC/openSUSE:Factory/.efivar.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "efivar"

Tue Mar 12 09:47:49 2019 rev:17 rq:682663 version:37

Changes:
--------
--- /work/SRC/openSUSE:Factory/efivar/efivar.changes    2019-02-26 
22:14:05.554238807 +0100
+++ /work/SRC/openSUSE:Factory/.efivar.new.28833/efivar.changes 2019-03-12 
09:47:51.263604564 +0100
@@ -1,0 +2,8 @@
+Fri Mar  8 03:16:22 UTC 2019 - Gary Ching-Pang Lin <g...@suse.com>
+
+- Add efivar-bsc1127544-fix-ucs2len.patch to fix logic that checks
+  for UCS-2 string termination (boo#1127544)
+- Add efivar-fix-efidp_ipv4_addr-fields-assignment.patch to fix the
+  casting of IPv4 address.
+
+-------------------------------------------------------------------

New:
----
  efivar-bsc1127544-fix-ucs2len.patch
  efivar-fix-efidp_ipv4_addr-fields-assignment.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ efivar.spec ++++++
--- /var/tmp/diff_new_pack.oQoYHa/_old  2019-03-12 09:47:52.527604313 +0100
+++ /var/tmp/diff_new_pack.oQoYHa/_new  2019-03-12 09:47:52.531604312 +0100
@@ -40,6 +40,8 @@
 Patch1:         efivar-make-format_guid-handle-misaligned-guid-pointer.patch
 # PATCH-FIX-UPSTREAM boo#1120862
 Patch2:         
efivar-Fix-all-the-places-Werror-address-of-packed-member-c.patch
+Patch3:         efivar-bsc1127544-fix-ucs2len.patch
+Patch4:         efivar-fix-efidp_ipv4_addr-fields-assignment.patch
 %if "0%{?buildroot}" == "0"
 # set a sane value for buildroot, unless it's already there!
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -84,6 +86,8 @@
 %endif
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 CFLAGS="%{optflags} -Wno-nonnull -flto"

++++++ efivar-bsc1127544-fix-ucs2len.patch ++++++
>From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:24 +0100
Subject: [PATCH 1/2] ucs2.h: remove unused variable

The const uint16_t pointer is not used since now the two bytes of the
UCS-2 chars are checked to know if is the termination of the string.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/ucs2.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/ucs2.h b/src/ucs2.h
index edd8367..e0390c3 100644
--- a/src/ucs2.h
+++ b/src/ucs2.h
@@ -26,12 +26,11 @@ static inline size_t UNUSED
 ucs2len(const void *vs, ssize_t limit)
 {
        ssize_t i;
-       const uint16_t *s = vs;
        const uint8_t *s8 = vs;
 
        for (i = 0;
             i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
-            i++, s8 += 2, s++)
+            i++, s8 += 2)
                ;
        return i;
 }
-- 
2.20.1


>From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:32 +0100
Subject: [PATCH 2/2] ucs2.h: fix logic that checks for UCS-2 string
 termination

Currently the loop to count the lenght of the UCS-2 string ends if either
of the two bytes are 0, but 0 is a valid value for UCS-2 character codes.

So only break the loop when 0 is the value for both UCS-2 char bytes.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/ucs2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ucs2.h b/src/ucs2.h
index e0390c3..fd8b056 100644
--- a/src/ucs2.h
+++ b/src/ucs2.h
@@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit)
        const uint8_t *s8 = vs;
 
        for (i = 0;
-            i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
+            i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0);
             i++, s8 += 2)
                ;
        return i;
-- 
2.20.1

++++++ efivar-fix-efidp_ipv4_addr-fields-assignment.patch ++++++
>From 836461e480e2249de134efeaef79588cab045d5c Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:36 +0100
Subject: [PATCH] dp-message: fix efidp_ipv4_addr fields assignment

The efidp_ipv4_addr structure has some 4-byte array fields to store IPv4
addresses and network mask. But the efidp_make_ipv4() function wrongly
casts these as a char * before dereferencing them to store a value.

Instead, cast it to a uint32_t * so the 32-bit value is correctly stored.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/dp-message.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/dp-message.c b/src/dp-message.c
index 6b8e907..55fa781 100644
--- a/src/dp-message.c
+++ b/src/dp-message.c
@@ -678,16 +678,16 @@ efidp_make_ipv4(uint8_t *buf, ssize_t size, uint32_t 
local, uint32_t remote,
                                        EFIDP_MSG_IPv4, sizeof (*ipv4));
        ssize_t req = sizeof (*ipv4);
        if (size && sz == req) {
-               *((char *)ipv4->local_ipv4_addr) = htonl(local);
-               *((char *)ipv4->remote_ipv4_addr) = htonl(remote);
+               *((uint32_t *)ipv4->local_ipv4_addr) = htonl(local);
+               *((uint32_t *)ipv4->remote_ipv4_addr) = htonl(remote);
                ipv4->local_port = htons(local_port);
                ipv4->remote_port = htons(remote_port);
                ipv4->protocol = htons(protocol);
                ipv4->static_ip_addr = 0;
                if (is_static)
                        ipv4->static_ip_addr = 1;
-               *((char *)ipv4->gateway) = htonl(gateway);
-               *((char *)ipv4->netmask) = htonl(netmask);
+               *((uint32_t *)ipv4->gateway) = htonl(gateway);
+               *((uint32_t *)ipv4->netmask) = htonl(netmask);
        }
 
        if (sz < 0)
-- 
2.20.1


Reply via email to