aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch')
-rw-r--r--testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch b/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
new file mode 100644
index 0000000000..5fbfce1136
--- /dev/null
+++ b/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
@@ -0,0 +1,18 @@
+diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
+index 4b39a28..c438af1 100644
+--- a/src/booleans.c
++++ b/src/booleans.c
+@@ -63,12 +63,11 @@ int security_get_boolean_names(char ***names, int *len)
+ }
+
+ for (i = 0; i < *len; i++) {
+- n[i] = (char *)malloc(_D_ALLOC_NAMLEN(namelist[i]));
++ n[i] = strdup(namelist[i]->d_name);
+ if (!n[i]) {
+ rc = -1;
+ goto bad_freen;
+ }
+- strcpy(n[i], namelist[i]->d_name);
+ }
+ rc = 0;
+ *names = n;