mirror of https://github.com/getdnsapi/getdns.git
Allow remaining data RDF to be zero size
Usefull for NSECs on empty non terminals!
This commit is contained in:
parent
682f10b271
commit
99f0026961
|
@ -701,10 +701,8 @@ static int bitmap_has_type(priv_getdns_rdf_iter *bitmap, uint16_t rr_type)
|
||||||
uint8_t window = rr_type >> 8;
|
uint8_t window = rr_type >> 8;
|
||||||
uint8_t subtype = rr_type & 0xFF;
|
uint8_t subtype = rr_type & 0xFF;
|
||||||
|
|
||||||
if (!bitmap)
|
if (!bitmap || (dptr = bitmap->pos) == (dend = bitmap->nxt))
|
||||||
return 0;
|
return 0;
|
||||||
dptr = bitmap->pos;
|
|
||||||
dend = bitmap->nxt;
|
|
||||||
|
|
||||||
/* Type Bitmap = ( Window Block # | Bitmap Length | Bitmap ) +
|
/* Type Bitmap = ( Window Block # | Bitmap Length | Bitmap ) +
|
||||||
* dptr[0] dptr[1] dptr[2:]
|
* dptr[0] dptr[1] dptr[2:]
|
||||||
|
|
|
@ -252,7 +252,7 @@ rdf_iter_find_nxt(priv_getdns_rdf_iter *i)
|
||||||
if (!(i->nxt = i->rdd_pos->special->rdf_end(
|
if (!(i->nxt = i->rdd_pos->special->rdf_end(
|
||||||
i->pkt, i->pkt_end, i->pos)))
|
i->pkt, i->pkt_end, i->pos)))
|
||||||
i->nxt = i->end;
|
i->nxt = i->end;
|
||||||
} else
|
} else /* RDF is for remaining data */
|
||||||
i->nxt = i->end;
|
i->nxt = i->end;
|
||||||
|
|
||||||
if (i->nxt <= i->end)
|
if (i->nxt <= i->end)
|
||||||
|
@ -304,8 +304,8 @@ priv_getdns_rdf_iter_next(priv_getdns_rdf_iter *i)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
i->rdd_pos += 1;
|
i->rdd_pos += 1;
|
||||||
if ((i->pos = i->nxt) >= i->end)
|
if ((i->pos = i->nxt) > i->end)
|
||||||
goto done; /* Out of rdata */
|
goto done; /* Overflow */
|
||||||
if (i->rdd_pos >= i->rdd_end && !(i->rdd_pos = i->rdd_repeat))
|
if (i->rdd_pos >= i->rdd_end && !(i->rdd_pos = i->rdd_repeat))
|
||||||
goto done; /* Remaining rdata, but out of definitions! */
|
goto done; /* Remaining rdata, but out of definitions! */
|
||||||
if (i->rdd_pos->type == GETDNS_RDF_REPEAT)
|
if (i->rdd_pos->type == GETDNS_RDF_REPEAT)
|
||||||
|
|
Loading…
Reference in New Issue