Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f37450f

Browse filesBrowse files
committed
dns: use length for building TXT string
Rely on the length reported by C-Ares rather than `\0`-termination for creating the JS string for a dns TXT response. Fixes: #30688 PR-URL: #30690 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 099d3fd commit f37450f
Copy full SHA for f37450f

File tree

Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎src/cares_wrap.cc‎

Copy file name to clipboardExpand all lines: src/cares_wrap.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,8 @@ int ParseTxtReply(Environment* env,
904904
uint32_t i = 0, j;
905905
uint32_t offset = ret->Length();
906906
for (j = 0; current != nullptr; current = current->next) {
907-
Local<String> txt = OneByteString(env->isolate(), current->txt);
907+
Local<String> txt =
908+
OneByteString(env->isolate(), current->txt, current->length);
908909

909910
// New record found - write out the current chunk
910911
if (current->record_start) {
Collapse file

‎test/parallel/test-dns-resolveany.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns-resolveany.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const answers = [
1111
{ type: 'AAAA', address: '::42', ttl: 123 },
1212
{ type: 'MX', priority: 42, exchange: 'foobar.com', ttl: 124 },
1313
{ type: 'NS', value: 'foobar.org', ttl: 457 },
14-
{ type: 'TXT', entries: [ 'v=spf1 ~all', 'xyz' ] },
14+
{ type: 'TXT', entries: [ 'v=spf1 ~all', 'xyz\0foo' ] },
1515
{ type: 'PTR', value: 'baz.org', ttl: 987 },
1616
{
1717
type: 'SOA',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.