summarylogtreecommitdiffstats
path: root/0001-libselinux-Fix-security_get_boolean_names-build-erro.patch
diff options
context:
space:
mode:
authorNicolas Iooss2019-08-24 17:58:50 +0200
committerNicolas Iooss2019-08-24 17:58:50 +0200
commit5985a36e0b29ca397c983469feac3e2c7a9cce6b (patch)
treea8574dde56740166a8c32f8fe3d4b835f8e44bad /0001-libselinux-Fix-security_get_boolean_names-build-erro.patch
parent1c29bef9b2ce6ed8b7373ab17877d7b54b765a9d (diff)
downloadaur-5985a36e0b29ca397c983469feac3e2c7a9cce6b.tar.gz
libselinux 2.9-3 update
Fix a build issue reported in https://aur.archlinux.org/packages/libselinux/#comment-705409
Diffstat (limited to '0001-libselinux-Fix-security_get_boolean_names-build-erro.patch')
-rw-r--r--0001-libselinux-Fix-security_get_boolean_names-build-erro.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/0001-libselinux-Fix-security_get_boolean_names-build-erro.patch b/0001-libselinux-Fix-security_get_boolean_names-build-erro.patch
new file mode 100644
index 000000000000..232aa8c1a4ca
--- /dev/null
+++ b/0001-libselinux-Fix-security_get_boolean_names-build-erro.patch
@@ -0,0 +1,49 @@
+From ee8f7a870c625de139aa271eae0c40578488c2f6 Mon Sep 17 00:00:00 2001
+From: Richard Haines <richard_c_haines@btinternet.com>
+Date: Mon, 8 Jul 2019 14:37:01 +0100
+Subject: [PATCH 1/1] libselinux: Fix security_get_boolean_names build error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When running 'make' from libselinux on Fedora 30 (gcc 9.1.1) the
+following error is reported:
+
+bute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wstrict-overflow=5
+-I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -c -o booleans.o
+booleans.c
+booleans.c: In function ‘security_get_boolean_names’:
+booleans.c:39:5: error: assuming signed overflow does not occur when
+changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Werror=strict-overflow]
+ 39 | int security_get_boolean_names(char ***names, int *len)
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+cc1: all warnings being treated as errors
+make[1]: *** [Makefile:171: booleans.o] Error 1
+
+This is caused by the '--i' in the: 'for (--i; i >= 0; --i)' loop.
+
+Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
+---
+ libselinux/src/booleans.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
+index ab1e0754e961..a9154ce86b5d 100644
+--- a/libselinux/src/booleans.c
++++ b/libselinux/src/booleans.c
+@@ -81,8 +81,10 @@ int security_get_boolean_names(char ***names, int *len)
+ free(namelist);
+ return rc;
+ bad_freen:
+- for (--i; i >= 0; --i)
+- free(n[i]);
++ if (i > 0) {
++ while (i >= 1)
++ free(n[--i]);
++ }
+ free(n);
+ bad:
+ goto out;
+--
+2.22.0
+