]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct error check on fr_base16_decode() for octets (CID #1503992) (#4623)
authorJames Jones <jejones3141@gmail.com>
Sat, 23 Jul 2022 11:47:23 +0000 (06:47 -0500)
committerGitHub <noreply@github.com>
Sat, 23 Jul 2022 11:47:23 +0000 (18:47 +0700)
network_max_size() returns ~0 for octets, which when stored in ret,
a ssize_t, becomes -1. (Presumably this reflects that its max length
can vary.) Thus it makes no sense for it to appear in the test of
fr_base16_decode()'s return value.

src/lib/util/value.c

index a730435c57eb39f92bc021e526f8f4b5cd30c762..4e2588d7990a80d2e7fc05da9bed9b85c636e3c3 100644 (file)
@@ -4716,9 +4716,7 @@ parse:
                 */
                fr_sbuff_set(&our_in, &hex_start);
 
-               if (unlikely(fr_base16_decode(NULL,
-                                             &FR_DBUFF_TMP(bin_buff, hex_len),
-                                             &our_in, false) != (ssize_t)ret) < 0) {
+               if (unlikely(fr_base16_decode(NULL, &FR_DBUFF_TMP(bin_buff, hex_len), &our_in, false) < 0)) {
                        talloc_free(bin_buff);
                        return fr_sbuff_error(&our_in);
                }