fix efibootmgr -v error
(cherry picked from commit e16a88b5676d76490e6551d998c15756f54724a3)
This commit is contained in:
parent
a8b0d8c3d3
commit
f941170d98
@ -0,0 +1,29 @@
|
||||
From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Tue, 5 Mar 2019 17:23:32 +0100
|
||||
Subject: [PATCH] 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 <javierm@redhat.com>
|
||||
---
|
||||
src/ucs2.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/ucs2.h b/src/ucs2.h
|
||||
index e0390c34..fd8b056a 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;
|
||||
--
|
||||
32
backport-ucs2.h-remove-unused-variable.patch
Normal file
32
backport-ucs2.h-remove-unused-variable.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Tue, 5 Mar 2019 17:23:24 +0100
|
||||
Subject: [PATCH] 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 <javierm@redhat.com>
|
||||
---
|
||||
src/ucs2.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/ucs2.h b/src/ucs2.h
|
||||
index edd8367b..e0390c34 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;
|
||||
}
|
||||
--
|
||||
10
efivar.spec
10
efivar.spec
@ -1,12 +1,14 @@
|
||||
Name: efivar
|
||||
Version: 37
|
||||
Release: 6
|
||||
Release: 7
|
||||
Summary: Tools and libraries to work with EFI variables
|
||||
License: LGPLv2.1
|
||||
URL: https://github.com/rhboot/%{name}
|
||||
Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
|
||||
Patch0001: first-fix-gcc9-new-waring.patch
|
||||
Patch0002: second-fix-gcc9-new-waring.patch
|
||||
Patch0003: backport-ucs2.h-remove-unused-variable.patch
|
||||
Patch0004: backport-ucs2.h-fix-logic-that-checks-for-UCS-2-string-termin.patch
|
||||
|
||||
BuildRequires: popt-devel glibc-static
|
||||
BuildRequires: gcc
|
||||
@ -65,6 +67,12 @@ export LDFLAGS="-flto-partition=none"
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Thu Mar 24 2022 xinghe <xinghe2@h-partners.com> - 37-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix efibootmgr -v error
|
||||
|
||||
* Fri Jul 30 2021 gaihuiying <gaihuiying1@huawei.com> - 37-6
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user