From: Miek Gieben Date: Tue, 26 Jul 2005 09:58:15 +0000 (+0000) Subject: obscure buglet fixed, where every 1 letter dname was converted to the root lab X-Git-Tag: release-0.70~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf2dfd0caf0135c80184d4291882599faeb97846;p=thirdparty%2Fldns.git obscure buglet fixed, where every 1 letter dname was converted to the root lab --- diff --git a/host2str.c b/host2str.c index 8ecf9489..9570e6a1 100644 --- a/host2str.c +++ b/host2str.c @@ -93,6 +93,7 @@ ldns_rdf2buffer_str_dname(ldns_buffer *output, ldns_rdf *dname) len = data[src_pos]; /* special case: root label */ + /* XXX also check the actual contents!!!! ??? */ if (1 == ldns_rdf_size(dname)) { ldns_buffer_printf(output, "."); } else { diff --git a/rr.c b/rr.c index 6fdd6396..2ac952a4 100644 --- a/rr.c +++ b/rr.c @@ -198,6 +198,7 @@ ldns_rr_new_frm_str(const char *str) ldns_buffer_free(rr_buf); return NULL; } + ldns_buffer_new_frm_data( rd_buf, rdata, strlen(rdata)); diff --git a/str2host.c b/str2host.c index 847ca649..3efd2480 100644 --- a/str2host.c +++ b/str2host.c @@ -166,7 +166,7 @@ ldns_str2rdf_dname(ldns_rdf **d, const char *str) } /* root label */ - if (1 == len) { + if (1 == len && *str == '.') { *d = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_DNAME, 1, "\0"); return LDNS_STATUS_OK; }