Skip to content

Commit bdccca2

Browse files
committed
Fix no-default-alpn with value in non-strict mode
1 parent 52e97c8 commit bdccca2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/generic/svcb.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static const svc_param_info_t svc_params[] = {
370370
// For "no-default-alpn", the presentation and wire format values MUST be
371371
// empty. When "no-default-alpn" is specified in an RR, "alpn" must also be
372372
// specified in order for the RR to be "self-consistent" (Section 2.4.3).
373-
SVC_PARAM("no-default-alpn", 2u, NO_VALUE, 0, 0),
373+
SVC_PARAM("no-default-alpn", 2u, NO_VALUE, parse_unknown, parse_unknown),
374374
// RFC9460 section 7.2:
375375
// The presentation value of the SvcParamValue is a single decimal integer
376376
// between 0 and 65535 in ASCII. ...
@@ -688,8 +688,9 @@ static really_inline int32_t check_mandatory(
688688
memcpy(&key, keys, sizeof(key));
689689
// no byteswap, compare big endian
690690

691-
assert(key != 0);
692-
691+
// mandatory is guaranteed to exist
692+
if (key == 0)
693+
continue;
693694
if ((missing_keys = (parameters == rdata->octets)))
694695
break;
695696
assert(rdata->octets - parameters >= 4);

0 commit comments

Comments
 (0)