public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-3448] libstdc++: Use "test.invalid." for invalid hostname
Date: Fri, 10 Sep 2021 14:11:12 +0000 (GMT)	[thread overview]
Message-ID: <20210910141112.DF8DF3858C39@sourceware.org> (raw)

https://gcc.gnu.org/g:7f8af6dc82a0dac0d97fdd4d1f2055e932f29216

commit r12-3448-g7f8af6dc82a0dac0d97fdd4d1f2055e932f29216
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Sep 10 15:08:27 2021 +0100

    libstdc++: Use "test.invalid." for invalid hostname
    
    This avoids test.invalid.some.domain being successfully resolved.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/experimental/net/internet/resolver/ops/lookup.cc:
            Fix invalid hostname to only match the .invalid TLD.

Diff:
---
 .../testsuite/experimental/net/internet/resolver/ops/lookup.cc        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/experimental/net/internet/resolver/ops/lookup.cc b/libstdc++-v3/testsuite/experimental/net/internet/resolver/ops/lookup.cc
index 69be194fa29..8bd4dbacad2 100644
--- a/libstdc++-v3/testsuite/experimental/net/internet/resolver/ops/lookup.cc
+++ b/libstdc++-v3/testsuite/experimental/net/internet/resolver/ops/lookup.cc
@@ -97,7 +97,7 @@ test03()
   std::error_code ec;
   io_context ctx;
   ip::tcp::resolver resolv(ctx);
-  auto addrs = resolv.resolve("test.invalid", "http", ec);
+  auto addrs = resolv.resolve("test.invalid.", "http", ec);
   VERIFY( ec );
   VERIFY( addrs.size() == 0 );
   VERIFY( addrs.begin() == addrs.end() );
@@ -105,7 +105,7 @@ test03()
 #if __cpp_exceptions
   bool caught = false;
   try {
-    resolv.resolve("test.invalid", "http");
+    resolv.resolve("test.invalid.", "http");
   } catch (const std::system_error& e) {
     caught = true;
     VERIFY( e.code() == ec );


                 reply	other threads:[~2021-09-10 14:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910141112.DF8DF3858C39@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).