libsepol/backport-libsepol-fix-reallocarray-imports.patch
2024-10-12 02:09:33 +00:00

46 lines
1.4 KiB
Diff

From cc1bd5e8344db1016a207c42f8c2962f42c2ffad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= <tweek@google.com>
Date: Thu, 3 Mar 2022 16:23:06 +1100
Subject: [PATCH] libsepol: fix reallocarray imports
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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")
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
Acked-by: James Carter <jwcart2@gmail.com>
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(+)
diff --git a/libsepol/src/kernel_to_common.c b/libsepol/src/kernel_to_common.c
index dc9e689e57..972499abc5 100644
--- a/libsepol/src/kernel_to_common.c
+++ b/libsepol/src/kernel_to_common.c
@@ -18,6 +18,7 @@
#include <sepol/policydb/hashtab.h>
#include <sepol/policydb/symtab.h>
+#include "private.h"
#include "kernel_to_common.h"
diff --git a/libsepol/src/util.c b/libsepol/src/util.c
index b7230564ba..1cd1308d16 100644
--- a/libsepol/src/util.c
+++ b/libsepol/src/util.c
@@ -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;