}
while (region->length != 0) {
size_t l = *region->base + 1;
- if (l > region->length) {
+ if (l == 1U || l > region->length) {
return (DNS_R_FORMERR);
}
isc_region_consume(region, l);
* no-default-alpn (0x00 0x02) without alpn, alpn is required.
*/
WIRE_INVALID(0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00),
+ /*
+ * Alpn(0x00 0x01) with zero length elements is invalid
+ */
+ WIRE_INVALID(0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x05,
+ 0x00, 0x00, 0x00, 0x00, 0x00),
WIRE_SENTINEL()
};
/* Test vectors from RFCXXXX */