summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/zonec.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/zonec.c')
-rw-r--r--usr.sbin/nsd/zonec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/nsd/zonec.c b/usr.sbin/nsd/zonec.c
index 02e1a056b83..1b20b84d90f 100644
--- a/usr.sbin/nsd/zonec.c
+++ b/usr.sbin/nsd/zonec.c
@@ -89,6 +89,10 @@ zparser_conv_hex(region_type *region, const char *hex, size_t len)
uint8_t *t;
int i;
+ if(len == 1 && hex[0] == '0') {
+ /* single 0 represents empty buffer */
+ return alloc_rdata(region, 0);
+ }
if (len % 2 != 0) {
zc_error_prev_line("number of hex digits must be a multiple of 2");
} else if (len > MAX_RDLENGTH * 2) {
@@ -639,6 +643,10 @@ zparser_conv_b64(region_type *region, const char *b64)
uint16_t *r = NULL;
int i;
+ if(strcmp(b64, "0") == 0) {
+ /* single 0 represents empty buffer */
+ return alloc_rdata(region, 0);
+ }
i = __b64_pton(b64, buffer, B64BUFSIZE);
if (i == -1) {
zc_error_prev_line("invalid base64 data");