Skip to contentSkip to conversation

libsepol: fix reallocarray imports

PATCH In review Thiébaud Weksteen 2 participants 3 messages Mar 3, 2022 – Mar 11, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol: fix reallocarray imports

In f0a5f6e, calls to reallocarray were introduced. Ensure that the correct header (private.h) is included when necessary.

Fixes f0a5f6e ("libsepol: use reallocarray wrapper to avoid overflows")

Test: Built using Android CI (glibc 2.17)

---
 libsepol/src/kernel_to_common.c | 1 +
 libsepol/src/util.c             | 2 ++
 2 files changed, 3 insertions(+)
libsepol/src/kernel_to_common.c +1 -0
index dc9e689e..972499ab 100644
@@ -18,6 +18,7 @@
 #include <sepol/policydb/hashtab.h>
 #include <sepol/policydb/symtab.h>
 
+#include "private.h"
 #include "kernel_to_common.h"
 
 
libsepol/src/util.c +2 -0
index b7230564..1cd1308d 100644
@@ -28,6 +28,8 @@
 #include <sepol/policydb/policydb.h>
 #include <sepol/policydb/util.h>
 
+#include "private.h"
+
 struct val_to_name {
 	unsigned int val;
 	char *name;
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thiébaud Weksteen

In f0a5f6e, calls to reallocarray were introduced. Ensure that the correct header (private.h) is included when necessary.

Fixes f0a5f6e ("libsepol: use reallocarray wrapper to avoid overflows")

Test: Built using Android CI (glibc 2.17)

Quoted 33 lines
---
 libsepol/src/kernel_to_common.c | 1 +
 libsepol/src/util.c             | 2 ++
 2 files changed, 3 insertions(+)
libsepol/src/kernel_to_common.c +1 -0
index dc9e689e..972499ab 100644
@@ -18,6 +18,7 @@
 #include <sepol/policydb/hashtab.h>
 #include <sepol/policydb/symtab.h>
 
+#include "private.h"
 #include "kernel_to_common.h"
 
 
libsepol/src/util.c +2 -1
index b7230564..1cd1308d 100644
@@ -28,6 +28,8 @@
 #include <sepol/policydb/policydb.h>
 #include <sepol/policydb/util.h>
 
+#include "private.h"
+
 struct val_to_name {
        unsigned int val;
        char *name;
--

2.35.1.574.g5d30c73bfb-goog

#2 lore raw
Quoted 12 lines · James Carter
Quoted 7 lines · Thiébaud Weksteen

In f0a5f6e, calls to reallocarray were introduced. Ensure that the correct header (private.h) is included when necessary.

Fixes f0a5f6e ("libsepol: use reallocarray wrapper to avoid overflows")

Test: Built using Android CI (glibc 2.17)

Merged.
Thanks,
Jim

Quoted 33 lines
Quoted 33 lines
---
 libsepol/src/kernel_to_common.c | 1 +
 libsepol/src/util.c             | 2 ++
 2 files changed, 3 insertions(+)
libsepol/src/kernel_to_common.c +1 -0
index dc9e689e..972499ab 100644
@@ -18,6 +18,7 @@
 #include <sepol/policydb/hashtab.h>
 #include <sepol/policydb/symtab.h>
 
+#include "private.h"
 #include "kernel_to_common.h"
 
 
libsepol/src/util.c +2 -1
index b7230564..1cd1308d 100644
@@ -28,6 +28,8 @@
 #include <sepol/policydb/policydb.h>
 #include <sepol/policydb/util.h>
 
+#include "private.h"
+
 struct val_to_name {
        unsigned int val;
        char *name;
--

2.35.1.574.g5d30c73bfb-goog