diff options
-rw-r--r-- | src/cares_wrap.cc | 3 | ||||
-rw-r--r-- | test/parallel/test-dns-resolveany.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 1fb0f47dd80..f7a02e469aa 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -904,7 +904,8 @@ int ParseTxtReply(Environment* env, uint32_t i = 0, j; uint32_t offset = ret->Length(); for (j = 0; current != nullptr; current = current->next) { - Local<String> txt = OneByteString(env->isolate(), current->txt); + Local<String> txt = + OneByteString(env->isolate(), current->txt, current->length); // New record found - write out the current chunk if (current->record_start) { diff --git a/test/parallel/test-dns-resolveany.js b/test/parallel/test-dns-resolveany.js index bb15b1a38b4..33beee847fd 100644 --- a/test/parallel/test-dns-resolveany.js +++ b/test/parallel/test-dns-resolveany.js @@ -11,7 +11,7 @@ const answers = [ { type: 'AAAA', address: '::42', ttl: 123 }, { type: 'MX', priority: 42, exchange: 'foobar.com', ttl: 124 }, { type: 'NS', value: 'foobar.org', ttl: 457 }, - { type: 'TXT', entries: [ 'v=spf1 ~all', 'xyz' ] }, + { type: 'TXT', entries: [ 'v=spf1 ~all', 'xyz\0foo' ] }, { type: 'PTR', value: 'baz.org', ttl: 987 }, { type: 'SOA', |