From cba5d2a5c94caa44422412930000258c9f220266 Mon Sep 17 00:00:00 2001 From: Rose Date: Tue, 13 Aug 2024 09:49:58 -0400 Subject: [PATCH] Use static declaration for array sizes to uuid functions --- include/sudo_util.h | 4 ++-- lib/util/uuid.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sudo_util.h b/include/sudo_util.h index cafbe62db0..a3f8d93231 100644 --- a/include/sudo_util.h +++ b/include/sudo_util.h @@ -350,9 +350,9 @@ sudo_dso_public void sudo_get_ttysize_v2(int fd, int *rowp, int *colp); #define sudo_get_ttysize(_a, _b, _c) sudo_get_ttysize_v2((_a), (_b), (_c)) /* uuid.c */ -sudo_dso_public void sudo_uuid_create_v1(unsigned char uuid_out[16]); +sudo_dso_public void sudo_uuid_create_v1(unsigned char uuid_out[restrict static 16]); #define sudo_uuid_create(_a) sudo_uuid_create_v1((_a)) -sudo_dso_public char *sudo_uuid_to_string_v1(const unsigned char uuid[restrict 16], char * restrict dst, size_t dstsiz); +sudo_dso_public char *sudo_uuid_to_string_v1(const unsigned char uuid[restrict static 16], char * restrict dst, size_t dstsiz); #define sudo_uuid_to_string(_a, _b, _c) sudo_uuid_to_string_v1((_a), (_b), (_c)) #endif /* SUDO_UTIL_H */ diff --git a/lib/util/uuid.c b/lib/util/uuid.c index d8c36027cf..1906b9d77a 100644 --- a/lib/util/uuid.c +++ b/lib/util/uuid.c @@ -50,7 +50,7 @@ struct uuid { * As per RFC 4122 section 4.4. */ void -sudo_uuid_create_v1(unsigned char uuid_out[16]) +sudo_uuid_create_v1(unsigned char uuid_out[restrict static 16]) { struct uuid uuid; @@ -71,7 +71,7 @@ sudo_uuid_create_v1(unsigned char uuid_out[16]) * Format a uuid as a 36-byte string (plus one for the NUL). */ char * -sudo_uuid_to_string_v1(const unsigned char uuid[restrict 16], char * restrict dst, size_t dstsiz) +sudo_uuid_to_string_v1(const unsigned char uuid[restrict static 16], char * restrict dst, size_t dstsiz) { const char hex[] = "0123456789abcdef"; char *cp = dst;