]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix these, too
authorAlan T. DeKok <aland@freeradius.org>
Tue, 26 Oct 2021 12:35:32 +0000 (08:35 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 26 Oct 2021 12:35:32 +0000 (08:35 -0400)
src/lib/util/base16.c
src/lib/util/base16.h

index 98793ff4bc19bf7d7390a104268528a8b07d2a0d..3136e53a8515843e76c72bb95b5f24269ae94ce4 100644 (file)
@@ -112,7 +112,7 @@ uint8_t const fr_base16_alphabet_decode_mc[UINT8_MAX + 1] = {
  *     - >=0 the number of bytes written to out.
  *     - <0 number of bytes we would have needed to print the next hexit.
  */
-ssize_t fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX])
+ssize_t fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX + 1])
 {
        fr_sbuff_t      our_out = FR_SBUFF(out);
        fr_dbuff_t      our_in = FR_DBUFF(in);
@@ -142,7 +142,7 @@ ssize_t fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphab
  *     - Length of decoded data.
  */
 ssize_t fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_sbuff_t *in,
-                             bool no_trailing, uint8_t const alphabet[static UINT8_MAX])
+                             bool no_trailing, uint8_t const alphabet[static UINT8_MAX + 1])
 {
        fr_sbuff_t      our_in = FR_SBUFF(in);
        fr_dbuff_t      our_out = FR_DBUFF(out);
index 3623ccb4832c145cd63be46f4e0e5a66a17284a4..917b0a7a04f70ff0c5ca70eda339be85ee48c4d8 100644 (file)
@@ -48,12 +48,12 @@ extern uint8_t const fr_base16_alphabet_decode_mc[UINT8_MAX + 1];   /* mixed case
  *     - true if c is a character from the base32 alphabet.
  *     - false if character is not in the base32 alphabet.
  */
-static inline bool fr_is_base16_nstd(char c, uint8_t const alphabet[static UINT8_MAX])
+static inline bool fr_is_base16_nstd(char c, uint8_t const alphabet[static UINT8_MAX + 1])
 {
        return alphabet[(uint8_t)c] < 16;
 }
 
-ssize_t                fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX]);
+ssize_t                fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX + 1]);
 #define                fr_base16_encode(_out, _in) \
                fr_base16_encode_nstd(_out, _in, fr_base16_alphabet_encode_lc)
 
@@ -91,7 +91,7 @@ static inline ssize_t fr_base16_aencode(TALLOC_CTX *ctx, char **out, fr_dbuff_t
 }
 
 ssize_t                fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_sbuff_t *in,
-                                     bool no_trailing, uint8_t const alphabet[static UINT8_MAX]);
+                                     bool no_trailing, uint8_t const alphabet[static UINT8_MAX + 1]);
 #define                fr_base16_decode(_err, _out, _in, _no_trailing) \
                fr_base16_decode_nstd(_err, _out, _in, _no_trailing, fr_base16_alphabet_decode_mc)