mirror of https://github.com/getdnsapi/getdns.git
Zero size only for non-repeating remaining data
This commit is contained in:
parent
16da0a01b5
commit
898fc15b6b
|
@ -54,7 +54,7 @@ typedef struct priv_getdns_rdf_special {
|
|||
|
||||
#define GETDNS_RDF_INTEGER 0x010000
|
||||
#define GETDNS_RDF_BINDATA 0x020000
|
||||
#define GETDNS_RDF_DNAME 0x060000
|
||||
#define GETDNS_RDF_DNAME 0x040000
|
||||
#define GETDNS_RDF_COMPRESSED 0x080000
|
||||
#define GETDNS_RDF_REPEAT 0x100000
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ rdf_iter_find_nxt(priv_getdns_rdf_iter *i)
|
|||
i->nxt = i->pos + 1 < i->end
|
||||
? i->pos + gldns_read_uint16(i->pos) + 2 : i->end;
|
||||
|
||||
else if ((i->rdd_pos->type & GETDNS_RDF_DNAME) == GETDNS_RDF_DNAME)
|
||||
else if (i->rdd_pos->type & GETDNS_RDF_DNAME)
|
||||
|
||||
for (pos = i->pos; pos < i->end; pos += *pos + 1) {
|
||||
if (!*pos) {
|
||||
|
@ -257,8 +257,12 @@ rdf_iter_find_nxt(priv_getdns_rdf_iter *i)
|
|||
} else /* RDF is for remaining data */
|
||||
i->nxt = i->end;
|
||||
|
||||
if ( i->nxt <= i->end
|
||||
&& (i->nxt > i->pos || !(i->rdd_pos->type & GETDNS_RDF_REPEAT)))
|
||||
if ( i->nxt <= i->end &&
|
||||
|
||||
/* Empty rdata fields are only allowed in case of non-repeating
|
||||
* remaining data. So only the GETDNS_RDF_BINDATA bit is set.
|
||||
*/
|
||||
(i->nxt > i->pos || (i->rdd_pos->type == GETDNS_RDF_BINDATA)))
|
||||
return i;
|
||||
done:
|
||||
i->pos = NULL;
|
||||
|
|
|
@ -271,8 +271,7 @@ priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
|
|||
default:
|
||||
goto rdata_error;
|
||||
}
|
||||
} else if ((rdf->rdd_pos->type & GETDNS_RDF_DNAME) ==
|
||||
GETDNS_RDF_DNAME) {
|
||||
} else if (rdf->rdd_pos->type & GETDNS_RDF_DNAME) {
|
||||
val_type = t_bindata;
|
||||
|
||||
bindata.data = priv_getdns_rdf_if_or_as_decompressed(
|
||||
|
|
Loading…
Reference in New Issue