From 853eea97803aad76fc9cec15fbbc9eb1196bbfa3 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 16 Oct 2017 11:59:43 +0200 Subject: [PATCH] Assume a single 0 character for empty Base64 rdata fields for now Awaiting the discussion on DOA --- host2str.c | 2 +- str2host.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.3