From e7483ae8e9661a63dd1e6548bffe359c34e80fc5 Mon Sep 17 00:00:00 2001 From: Rose Date: Tue, 13 Aug 2024 11:24:45 -0400 Subject: [PATCH] Restrict-qualify stat_multiarch --- include/sudo_util.h | 2 +- lib/util/multiarch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sudo_util.h b/include/sudo_util.h index f59cd98992..cafbe62db0 100644 --- a/include/sudo_util.h +++ b/include/sudo_util.h @@ -242,7 +242,7 @@ sudo_dso_public int sudo_mmap_protect_v1(void *ptr); #define sudo_mmap_protect(_a) sudo_mmap_protect_v1(_a) /* multiarch.c */ -sudo_dso_public char *sudo_stat_multiarch_v1(const char *path, struct stat *sb); +sudo_dso_public char *sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb); #define sudo_stat_multiarch(_a, _b) sudo_stat_multiarch_v1((_a), (_b)) /* parseln.c */ diff --git a/lib/util/multiarch.c b/lib/util/multiarch.c index 0b79de5904..907a99cc71 100644 --- a/lib/util/multiarch.c +++ b/lib/util/multiarch.c @@ -44,7 +44,7 @@ * Returns a dynamically allocated string on success and NULL on failure. */ char * -sudo_stat_multiarch_v1(const char *path, struct stat *sb) +sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb) { # if defined(__ILP32__) const char *libdirs[] = { "/libx32/", "/lib/", "/libexec/", NULL }; @@ -96,7 +96,7 @@ sudo_stat_multiarch_v1(const char *path, struct stat *sb) } #else char * -sudo_stat_multiarch_v1(const char *path, struct stat *sb) +sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb) { return NULL; }