]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fill missed element in decode array
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 16:59:30 +0000 (12:59 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 17:17:09 +0000 (13:17 -0400)
Break if either !a || !b even if it's not an error

src/lib/util/base16.c
src/tests/unit/xlat/base.txt

index 3136e53a8515843e76c72bb95b5f24269ae94ce4..5667ea2d069a637a3982b8c0c122c66fdbf6c6fc 100644 (file)
@@ -98,7 +98,7 @@ uint8_t const fr_base16_alphabet_decode_mc[UINT8_MAX + 1] = {
        ['d'] = 13,
        ['e'] = 14,
        ['f'] = 15,
-       F128(103, UINT8_MAX), F16(231, UINT8_MAX), F8(247, UINT8_MAX)
+       F128(103, UINT8_MAX), F16(231, UINT8_MAX), F8(247, UINT8_MAX), F1(255, UINT8_MAX)
 };
 
 /** Convert binary data to a hex string
@@ -158,6 +158,7 @@ ssize_t fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_s
                                if (err) *err = FR_SBUFF_PARSE_ERROR_TRAILING;
                                return -fr_sbuff_used(&our_in);
                        }
+                       break;
                }
 
                FR_DBUFF_IN_BYTES_RETURN(&our_out, (alphabet[us(p[0])] << 4) | alphabet[us(p[1])]);
index bd95052e9e7c77517666c5b9e19aba41442b550c..bb2b790b78b8038a84688222604bbd548c183342 100644 (file)
@@ -64,7 +64,7 @@ xlat %{33}
 match ERROR offset 2: Invalid regex reference.  Must be in range 0-32
 
 xlat %{3a}
-match ERROR offset 2: Invalid regex reference.  Must be in range 0-32
+match ERROR offset 2: Unexpected text after attribute reference
 
 xlat %{-3}
 match ERROR offset 2: Unresolved attributes not allowed in expansions here