2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Merge branch '4362-qp-crash' into 'main'

check chain length is nonzero before examining last entry

Closes #4362

See merge request isc-projects/bind9!8370
This commit is contained in:
Evan Hunt
2023-10-12 19:04:14 +00:00

View File

@@ -1997,7 +1997,7 @@ dns_qp_getname(dns_qpreadable_t qpr, const dns_name_t *name, void **pval_r,
static inline void
add_link(dns_qpchain_t *chain, dns_qpnode_t *node, size_t offset) {
/* prevent duplication */
if (chain->chain[chain->len - 1].node == node) {
if (chain->len != 0 && chain->chain[chain->len - 1].node == node) {
return;
}
chain->chain[chain->len].node = node;