From: Willem Toorop Date: Mon, 16 Oct 2017 09:59:43 +0000 (+0200) Subject: Assume a single 0 character for empty Base64 rdata fields for now X-Git-Tag: release-1.7.1-rc1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=853eea97803aad76fc9cec15fbbc9eb1196bbfa3;p=thirdparty%2Fldns.git Assume a single 0 character for empty Base64 rdata fields for now Awaiting the discussion on DOA --- diff --git a/host2str.c b/host2str.c index 7dab51f8..73adb39a 100644 --- a/host2str.c +++ b/host2str.c @@ -479,7 +479,7 @@ ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf) char *b64; if (ldns_rdf_size(rdf) == 0) { - ldns_buffer_printf(output, "-"); + ldns_buffer_printf(output, "0"); return ldns_buffer_status(output); } else size = ldns_b64_ntop_calculate_size(ldns_rdf_size(rdf)); diff --git a/str2host.c b/str2host.c index a3511ad4..10d18925 100644 --- a/str2host.c +++ b/str2host.c @@ -584,7 +584,7 @@ ldns_str2rdf_b64(ldns_rdf **rd, const char *str) uint8_t *buffer; int16_t i; - if (*str == '-' && str[1] == '\0') { + if ((*str == '-' || *str == '0') && str[1] == '\0') { *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, 0, NULL); return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR; }