diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-22 10:44:30 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-22 10:45:47 +0200 |
commit | da6898cd56de992c7e6976997474dabb082d5beb (patch) | |
tree | c3cc1e8a5d44bf2a5142acccf5be760251df3699 | |
parent | 1e31398e26bb97487a29259eba339c3b65415bcf (diff) | |
download | alpine_aports-da6898cd56de992c7e6976997474dabb082d5beb.tar.bz2 alpine_aports-da6898cd56de992c7e6976997474dabb082d5beb.tar.xz alpine_aports-da6898cd56de992c7e6976997474dabb082d5beb.zip |
community/efivar: backport upstream fix for UCS2 logic
fixes #11523
-rw-r--r-- | community/efivar/APKBUILD | 9 | ||||
-rw-r--r-- | community/efivar/efivar-fix-logic-that-checks-for-UCS-2-string-termination.patch | 28 | ||||
-rw-r--r-- | community/efivar/efivar-fix-ucs2.patch | 59 |
3 files changed, 93 insertions, 3 deletions
diff --git a/community/efivar/APKBUILD b/community/efivar/APKBUILD index f86e8ec751..510de1d2d8 100644 --- a/community/efivar/APKBUILD +++ b/community/efivar/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | # Maintainer: Lucas Ramage <ramage.lucas@protonmail.com> | 2 | # Maintainer: Lucas Ramage <ramage.lucas@protonmail.com> |
3 | pkgname=efivar | 3 | pkgname=efivar |
4 | pkgver=37 | 4 | pkgver=37 |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="Tools and library to manipulate EFI variables" | 6 | pkgdesc="Tools and library to manipulate EFI variables" |
7 | url="https://github.com/rhboot/efivar" | 7 | url="https://github.com/rhboot/efivar" |
8 | arch="x86 x86_64 armhf armv7 aarch64 ppc64le" | 8 | arch="x86 x86_64 armhf armv7 aarch64 ppc64le" |
@@ -15,7 +15,9 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-libs" | |||
15 | source="https://github.com/rhboot/efivar/releases/download/$pkgver/efivar-$pkgver.tar.bz2 | 15 | source="https://github.com/rhboot/efivar/releases/download/$pkgver/efivar-$pkgver.tar.bz2 |
16 | efivar-fix-format_guid.patch | 16 | efivar-fix-format_guid.patch |
17 | efivar-fix-packed.patch | 17 | efivar-fix-packed.patch |
18 | musl-bswap.patch" | 18 | musl-bswap.patch |
19 | efivar-fix-ucs2.patch | ||
20 | " | ||
19 | builddir="$srcdir/efivar-$pkgver" | 21 | builddir="$srcdir/efivar-$pkgver" |
20 | 22 | ||
21 | build() { | 23 | build() { |
@@ -35,4 +37,5 @@ check() { | |||
35 | sha512sums="305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4 efivar-37.tar.bz2 | 37 | sha512sums="305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4 efivar-37.tar.bz2 |
36 | 78f8f1e41e088440802815fab1e1474b1c98a9362c7bac178ea5eb9c457ad3045e21f2ee700dc95b9e805339e976f0218b6faad663f2f99838ddfa85ce12bb14 efivar-fix-format_guid.patch | 38 | 78f8f1e41e088440802815fab1e1474b1c98a9362c7bac178ea5eb9c457ad3045e21f2ee700dc95b9e805339e976f0218b6faad663f2f99838ddfa85ce12bb14 efivar-fix-format_guid.patch |
37 | 0be6e0fe6f2619bcedaf97006afaeeca2d195a90636ecc73b598c3157abaf55bb956f67e6ab12f680c9c874e496ce2093ee2ba6940a170fd9fed0165bbbcca97 efivar-fix-packed.patch | 39 | 0be6e0fe6f2619bcedaf97006afaeeca2d195a90636ecc73b598c3157abaf55bb956f67e6ab12f680c9c874e496ce2093ee2ba6940a170fd9fed0165bbbcca97 efivar-fix-packed.patch |
38 | 84fd5baf91df91889cfcfed2bcf59f073dc754f6aba1944059203bbe99f4bbb6dc92addff9fae8f687a2c95f9438b0eb301dd0320728a8a2a6edd5e2b2b5ba94 musl-bswap.patch" | 40 | 84fd5baf91df91889cfcfed2bcf59f073dc754f6aba1944059203bbe99f4bbb6dc92addff9fae8f687a2c95f9438b0eb301dd0320728a8a2a6edd5e2b2b5ba94 musl-bswap.patch |
41 | 4eb0459bbffe5a11ecaf004be0ec8589f7439629732fb07944390d7d354537e8318b7f3b6d0729672f12a7b927f0d2907fe5b517aa6f6e9cc1d64b525f3c79ce efivar-fix-ucs2.patch" | ||
diff --git a/community/efivar/efivar-fix-logic-that-checks-for-UCS-2-string-termination.patch b/community/efivar/efivar-fix-logic-that-checks-for-UCS-2-string-termination.patch new file mode 100644 index 0000000000..176e3fd197 --- /dev/null +++ b/community/efivar/efivar-fix-logic-that-checks-for-UCS-2-string-termination.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001 | ||
2 | From: Javier Martinez Canillas <javierm@redhat.com> | ||
3 | Date: Tue, 5 Mar 2019 17:23:32 +0100 | ||
4 | Subject: [PATCH] ucs2.h: fix logic that checks for UCS-2 string termination | ||
5 | |||
6 | Currently the loop to count the lenght of the UCS-2 string ends if either | ||
7 | of the two bytes are 0, but 0 is a valid value for UCS-2 character codes. | ||
8 | |||
9 | So only break the loop when 0 is the value for both UCS-2 char bytes. | ||
10 | |||
11 | Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> | ||
12 | --- | ||
13 | src/ucs2.h | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/src/ucs2.h b/src/ucs2.h | ||
17 | index e0390c3..fd8b056 100644 | ||
18 | --- a/src/ucs2.h | ||
19 | +++ b/src/ucs2.h | ||
20 | @@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit) | ||
21 | const uint8_t *s8 = vs; | ||
22 | |||
23 | for (i = 0; | ||
24 | - i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; | ||
25 | + i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0); | ||
26 | i++, s8 += 2) | ||
27 | ; | ||
28 | return i; | ||
diff --git a/community/efivar/efivar-fix-ucs2.patch b/community/efivar/efivar-fix-ucs2.patch new file mode 100644 index 0000000000..594da617cd --- /dev/null +++ b/community/efivar/efivar-fix-ucs2.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001 | ||
2 | From: Javier Martinez Canillas <javierm@redhat.com> | ||
3 | Date: Tue, 5 Mar 2019 17:23:24 +0100 | ||
4 | Subject: [PATCH] ucs2.h: remove unused variable | ||
5 | |||
6 | The const uint16_t pointer is not used since now the two bytes of the | ||
7 | UCS-2 chars are checked to know if is the termination of the string. | ||
8 | |||
9 | Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> | ||
10 | --- | ||
11 | src/ucs2.h | 3 +-- | ||
12 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/src/ucs2.h b/src/ucs2.h | ||
15 | index edd8367..e0390c3 100644 | ||
16 | --- a/src/ucs2.h | ||
17 | +++ b/src/ucs2.h | ||
18 | @@ -26,12 +26,11 @@ static inline size_t UNUSED | ||
19 | ucs2len(const void *vs, ssize_t limit) | ||
20 | { | ||
21 | ssize_t i; | ||
22 | - const uint16_t *s = vs; | ||
23 | const uint8_t *s8 = vs; | ||
24 | |||
25 | for (i = 0; | ||
26 | i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; | ||
27 | - i++, s8 += 2, s++) | ||
28 | + i++, s8 += 2) | ||
29 | ; | ||
30 | return i; | ||
31 | } | ||
32 | From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001 | ||
33 | From: Javier Martinez Canillas <javierm@redhat.com> | ||
34 | Date: Tue, 5 Mar 2019 17:23:32 +0100 | ||
35 | Subject: [PATCH] ucs2.h: fix logic that checks for UCS-2 string termination | ||
36 | |||
37 | Currently the loop to count the lenght of the UCS-2 string ends if either | ||
38 | of the two bytes are 0, but 0 is a valid value for UCS-2 character codes. | ||
39 | |||
40 | So only break the loop when 0 is the value for both UCS-2 char bytes. | ||
41 | |||
42 | Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> | ||
43 | --- | ||
44 | src/ucs2.h | 2 +- | ||
45 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
46 | |||
47 | diff --git a/src/ucs2.h b/src/ucs2.h | ||
48 | index e0390c3..fd8b056 100644 | ||
49 | --- a/src/ucs2.h | ||
50 | +++ b/src/ucs2.h | ||
51 | @@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit) | ||
52 | const uint8_t *s8 = vs; | ||
53 | |||
54 | for (i = 0; | ||
55 | - i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; | ||
56 | + i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0); | ||
57 | i++, s8 += 2) | ||
58 | ; | ||
59 | return i; | ||