]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
limit this to DNS labels
authorAlan T. DeKok <aland@freeradius.org>
Wed, 16 Mar 2022 20:33:56 +0000 (16:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 17 Mar 2022 14:46:51 +0000 (10:46 -0400)
src/protocols/dhcpv6/decode.c

index f00b4e21f43cd529b9878dead6da6ed5a9de5837..b35cd1a830a6efbc677bce437b9dbfd047bfca83 100644 (file)
@@ -116,7 +116,9 @@ static ssize_t decode_value_trampoline(TALLOC_CTX *ctx, fr_pair_list_t *out,
        /*
         *      @todo - we might need to limit this to only one DNS label.
         */
-       if ((parent->type == FR_TYPE_STRING) && !parent->flags.extra && parent->flags.subtype) {
+       if ((parent->type == FR_TYPE_STRING) && !parent->flags.extra &&
+           ((parent->flags.subtype == FLAG_ENCODE_DNS_LABEL) ||
+            (parent->flags.subtype == FLAG_ENCODE_PARTIAL_DNS_LABEL))) {
                return decode_dns_labels(ctx, out, parent, data, data_len, decode_ctx);
        }
 
@@ -572,7 +574,10 @@ static ssize_t decode_option(TALLOC_CTX *ctx, fr_pair_list_t *out,
                }
 
                fr_pair_append(out, vp);
-       } else if ((da->type == FR_TYPE_STRING) && !da->flags.extra && da->flags.subtype) {
+
+       } else if ((da->type == FR_TYPE_STRING) && !da->flags.extra &&
+                  ((da->flags.subtype == FLAG_ENCODE_DNS_LABEL) ||
+                   (da->flags.subtype == FLAG_ENCODE_PARTIAL_DNS_LABEL))) {
                fr_pair_list_t tmp;
 
                fr_pair_list_init(&tmp);