mirror of https://github.com/getdnsapi/getdns.git
Fixes for miscelanous little zone parse errors
Hopefully the tpkg test is more deterministic now too...
This commit is contained in:
parent
11cd892662
commit
f9c2f96996
|
@ -534,7 +534,7 @@ _getdns_fp2rr_list(struct mem_funcs *mf,
|
||||||
|
|
||||||
if (!origin) {
|
if (!origin) {
|
||||||
*pst.origin = 0;
|
*pst.origin = 0;
|
||||||
pst.origin_len = 0;
|
pst.origin_len = 1;
|
||||||
|
|
||||||
} else if (gldns_str2wire_dname_buf(origin,pst.origin,&pst.origin_len))
|
} else if (gldns_str2wire_dname_buf(origin,pst.origin,&pst.origin_len))
|
||||||
return GETDNS_RETURN_GENERIC_ERROR;
|
return GETDNS_RETURN_GENERIC_ERROR;
|
||||||
|
@ -556,6 +556,10 @@ _getdns_fp2rr_list(struct mem_funcs *mf,
|
||||||
dname_len = 0;
|
dname_len = 0;
|
||||||
if (gldns_fp2wire_rr_buf(in, rr, &len, &dname_len, &pst))
|
if (gldns_fp2wire_rr_buf(in, rr, &len, &dname_len, &pst))
|
||||||
break;
|
break;
|
||||||
|
if (dname_len && dname_len < sizeof(pst.prev_rr)) {
|
||||||
|
memcpy(pst.prev_rr, rr, dname_len);
|
||||||
|
pst.prev_rr_len = dname_len;
|
||||||
|
}
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
continue;
|
continue;
|
||||||
if ((r = _getdns_wire2rr_dict(mf, rr, len, &rr_dict)))
|
if ((r = _getdns_wire2rr_dict(mf, rr, len, &rr_dict)))
|
||||||
|
|
|
@ -867,7 +867,7 @@ int gldns_fp2wire_rr_buf(FILE* in, uint8_t* rr, size_t* len, size_t* dname_len,
|
||||||
return s;
|
return s;
|
||||||
} else if(strncmp(line, "$TTL", 4) == 0 && isspace(line[4])) {
|
} else if(strncmp(line, "$TTL", 4) == 0 && isspace(line[4])) {
|
||||||
const char* end = NULL;
|
const char* end = NULL;
|
||||||
size_t off = 8;
|
size_t off = 5;
|
||||||
*len = 0;
|
*len = 0;
|
||||||
*dname_len = 0;
|
*dname_len = 0;
|
||||||
if(!parse_state) return GLDNS_WIREPARSE_ERR_OK;
|
if(!parse_state) return GLDNS_WIREPARSE_ERR_OK;
|
||||||
|
|
|
@ -267,6 +267,20 @@ int main(int argc, char const * const argv[])
|
||||||
if (r == GETDNS_RETURN_NEED_MORE_SPACE) {
|
if (r == GETDNS_RETURN_NEED_MORE_SPACE) {
|
||||||
printf("record %.3zu, available buffer space: "
|
printf("record %.3zu, available buffer space: "
|
||||||
"%zi\n", i, available);
|
"%zi\n", i, available);
|
||||||
|
|
||||||
|
/* The buffer was too small to fit the wire-
|
||||||
|
* format representation. available now holds
|
||||||
|
* a negative number. the wire pointer is this
|
||||||
|
* much beyond the end of the buffer space.
|
||||||
|
*
|
||||||
|
* If we would add available to wire, wire
|
||||||
|
* would be positioned at the end of the buffer
|
||||||
|
* but would not be positioned at a clean RR
|
||||||
|
* border. Therefore we have to remember the
|
||||||
|
* previous position of wire, so we can reset
|
||||||
|
* it at the end of the wireformat representa-
|
||||||
|
* tion of the previously converted rr_dict.
|
||||||
|
*/
|
||||||
wire = prev_wire;
|
wire = prev_wire;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,7 +8,6 @@ net-dns.org IN SOA ns.nlnetlabs.nl. sysadmin.nlnetlabs.nl. (
|
||||||
345600 ; expire (4 days)
|
345600 ; expire (4 days)
|
||||||
300 ; minimum (5 minutes)
|
300 ; minimum (5 minutes)
|
||||||
)
|
)
|
||||||
$ORIGIN net-dns.org.
|
|
||||||
NS ns.nlnetlabs.nl
|
NS ns.nlnetlabs.nl
|
||||||
NS ns.hactrn.net.
|
NS ns.hactrn.net.
|
||||||
NS mcvax.nlnet.nl.
|
NS mcvax.nlnet.nl.
|
||||||
|
@ -20,6 +19,7 @@ $ORIGIN net-dns.org.
|
||||||
MX 10 dicht.nlnetlabs.nl.
|
MX 10 dicht.nlnetlabs.nl.
|
||||||
MX 20 mcvax.nlnet.nl.
|
MX 20 mcvax.nlnet.nl.
|
||||||
TXT "Net::DNS domain"
|
TXT "Net::DNS domain"
|
||||||
|
$ORIGIN net-dns.org.
|
||||||
_443._tcp TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923
|
_443._tcp TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923
|
||||||
_443._tcp.www TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923
|
_443._tcp.www TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue