summaryrefslogtreecommitdiff
path: root/rr.c
diff options
context:
space:
mode:
authorWouter Wijngaards <wouter@NLnetLabs.nl>2010-10-11 15:03:35 +0200
committerWouter Wijngaards <wouter@NLnetLabs.nl>2010-10-11 15:03:35 +0200
commitb55fbbfd219e8b17f7db5c0985c50ad775b53c8d (patch)
tree03a55a6d01207d443dff64bb3142a917b3547b94 /rr.c
parentd715c5ca85586b502f8a78f5240801caa2999f92 (diff)
downloadldns-b55fbbfd219e8b17f7db5c0985c50ad775b53c8d.tar.gz
* bugfix: read of RR in unknown syntax with missing fields.
Diffstat (limited to 'rr.c')
-rw-r--r--rr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rr.c b/rr.c
index 9a3aa1d9..60ce4985 100644
--- a/rr.c
+++ b/rr.c
@@ -121,6 +121,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
ssize_t c;
ldns_rdf *owner_dname;
const char* endptr;
+ int was_unknown_rr_format = 0;
/* used for types with unknown number of rdatas */
bool done;
@@ -410,6 +411,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
char *hex_data_str;
uint16_t cur_hex_data_size;
+ was_unknown_rr_format = 1;
/* go back to before \# and skip it while setting delimiters better */
ldns_buffer_set_position(rd_buf, pre_data_pos);
delimiters = "\n\t ";
@@ -538,7 +540,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
ldns_buffer_free(rr_buf);
LDNS_FREE(rdata);
- if (!question && desc && ldns_rr_rd_count(new) < r_min) {
+ if (!question && desc && !was_unknown_rr_format && ldns_rr_rd_count(new) < r_min) {
ldns_rr_free(new);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}