mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-17 21:25:50 +02:00
- Fix ipset module to use larger domain name buffers, and
check buffer lengths. Thanks to Qifan Zhang, Palo Alto Networks for the report.
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
- Fix that quotation and escaping works the same in auth-zone
|
- Fix that quotation and escaping works the same in auth-zone
|
||||||
url content, as in the zonefile read. Thanks to Qifan Zhang,
|
url content, as in the zonefile read. Thanks to Qifan Zhang,
|
||||||
Palo Alto Networks for the report.
|
Palo Alto Networks for the report.
|
||||||
|
- Fix ipset module to use larger domain name buffers, and
|
||||||
|
check buffer lengths. Thanks to Qifan Zhang, Palo Alto
|
||||||
|
Networks for the report.
|
||||||
|
|
||||||
3 June 2026: Yorgos
|
3 June 2026: Yorgos
|
||||||
- Fix const as reported by newest compiler warnings.
|
- Fix const as reported by newest compiler warnings.
|
||||||
|
|||||||
+6
-6
@@ -219,15 +219,15 @@ ipset_check_zones_for_rrset(struct module_env *env, struct ipset_env *ie,
|
|||||||
struct ub_packed_rrset_key *rrset, const char *qname, int qlen,
|
struct ub_packed_rrset_key *rrset, const char *qname, int qlen,
|
||||||
const char *setname, int af)
|
const char *setname, int af)
|
||||||
{
|
{
|
||||||
char dname[BUFF_LEN];
|
char dname[LDNS_MAX_DOMAINLEN*4+16];
|
||||||
const char *ds, *qs;
|
const char *ds, *qs;
|
||||||
int dlen, plen;
|
int dlen, plen;
|
||||||
|
|
||||||
struct config_strlist *p;
|
struct config_strlist *p;
|
||||||
struct packed_rrset_data *d;
|
struct packed_rrset_data *d;
|
||||||
|
|
||||||
dlen = sldns_wire2str_dname_buf(rrset->rk.dname, rrset->rk.dname_len, dname, BUFF_LEN);
|
dlen = sldns_wire2str_dname_buf(rrset->rk.dname, rrset->rk.dname_len, dname, sizeof(dname));
|
||||||
if (dlen == 0) {
|
if (dlen == 0 || dlen >= (int)sizeof(dname)) {
|
||||||
log_err("bad domain name");
|
log_err("bad domain name");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ static int ipset_update(struct module_env *env, struct dns_msg *return_msg,
|
|||||||
const char *setname;
|
const char *setname;
|
||||||
struct ub_packed_rrset_key *rrset;
|
struct ub_packed_rrset_key *rrset;
|
||||||
int af;
|
int af;
|
||||||
char qname[BUFF_LEN];
|
char qname[LDNS_MAX_DOMAINLEN*4+16];
|
||||||
int qlen;
|
int qlen;
|
||||||
|
|
||||||
#ifdef HAVE_NET_PFVAR_H
|
#ifdef HAVE_NET_PFVAR_H
|
||||||
@@ -285,8 +285,8 @@ static int ipset_update(struct module_env *env, struct dns_msg *return_msg,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
qlen = sldns_wire2str_dname_buf(qinfo.qname, qinfo.qname_len,
|
qlen = sldns_wire2str_dname_buf(qinfo.qname, qinfo.qname_len,
|
||||||
qname, BUFF_LEN);
|
qname, sizeof(qname));
|
||||||
if(qlen == 0) {
|
if(qlen == 0 || qlen >= (int)sizeof(qname)) {
|
||||||
log_err("bad domain name");
|
log_err("bad domain name");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user