commit: fe28b8a17d810b3356fc60443584ad1cdb9e34a4
parent 3bf1114d04bf5f715b1d3ca44fdddca13afea62f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 4 Jan 2026 12:06:02 +0100
lib,libutils: use static in array length of parameters to force array-bounds checks
Diffstat:
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sha1.h b/lib/sha1.h
@@ -18,4 +18,4 @@ void sha1_update(void *ctx, const void *m, unsigned long len);
/* get message digest */
/* state is ruined after sum, keep a copy if multiple sum is needed */
/* part of the message might be left in s, zero it if secrecy is needed */
-void sha1_sum(void *ctx, uint8_t md[SHA1_DIGEST_LENGTH]);
+void sha1_sum(void *ctx, uint8_t md[static SHA1_DIGEST_LENGTH]);
diff --git a/lib/sha256.h b/lib/sha256.h
@@ -21,4 +21,4 @@ void sha256_update(void *ctx, const void *m, unsigned long len);
/* get message digest */
/* state is ruined after sum, keep a copy if multiple sum is needed */
/* part of the message might be left in s, zero it if secrecy is needed */
-void sha256_sum(void *ctx, uint8_t md[SHA256_DIGEST_LENGTH]);
+void sha256_sum(void *ctx, uint8_t md[static SHA256_DIGEST_LENGTH]);
diff --git a/lib/sha512.h b/lib/sha512.h
@@ -21,4 +21,4 @@ void sha512_update(void *ctx, const void *m, unsigned long len);
/* get message digest */
/* state is ruined after sum, keep a copy if multiple sum is needed */
/* part of the message might be left in s, zero it if secrecy is needed */
-void sha512_sum(void *ctx, uint8_t md[SHA512_DIGEST_LENGTH]);
+void sha512_sum(void *ctx, uint8_t md[static SHA512_DIGEST_LENGTH]);
diff --git a/libutils/mode.h b/libutils/mode.h
@@ -9,7 +9,7 @@ mode_t new_mode(const char *mode, mode_t old, const char **errstr);
// Octal file mode in `mode`, symbolic version in `str`
// Example: mode=040755 ; str="drwxr-xr-x"
-void symbolize_mode(mode_t mode, char str[11]);
+void symbolize_mode(mode_t mode, char str[static 11]);
// Return full type name based on the mode
const char *filetype(struct stat *st);