File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/aws-cpp-sdk-core/source/internal Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1010#include < aws/core/http/HttpResponse.h>
1111#include < aws/core/utils/logging/LogMacros.h>
1212#include < aws/core/utils/ARN.h>
13+ #include < aws/core/utils/DNS.h>
1314#include < aws/core/utils/StringUtils.h>
1415#include < aws/core/utils/HashingUtils.h>
1516#include < aws/core/platform/Environment.h>
@@ -550,6 +551,16 @@ namespace Aws
550551 {
551552 ss << " .cn" ;
552553 }
554+
555+ Aws::Http::URI uri (ss.str ());
556+ if (!Aws::Utils::IsValidHost (uri.GetHost ()))
557+ {
558+ AWS_LOGSTREAM_ERROR (STS_RESOURCE_CLIENT_LOG_TAG,
559+ " Invalid endpoint host constructed: " << uri.GetHost ());
560+ m_endpoint.clear ();
561+ return ;
562+ }
563+
553564 m_endpoint = ss.str ();
554565
555566 AWS_LOGSTREAM_INFO (STS_RESOURCE_CLIENT_LOG_TAG, " Creating STS ResourceClient with endpoint: " << m_endpoint);
@@ -685,6 +696,16 @@ namespace Aws
685696 {
686697 ss << " .cn" ;
687698 }
699+ ss.str ();
700+
701+ Aws::Http::URI uri (ss.str ());
702+ if (!Aws::Utils::IsValidHost (uri.GetHost ()))
703+ {
704+ AWS_LOGSTREAM_ERROR (SSO_RESOURCE_CLIENT_LOG_TAG,
705+ " Invalid endpoint host constructed: " << uri.GetHost ());
706+ return {};
707+ }
708+
688709 return ss.str ();
689710 }
690711
You can’t perform that action at this time.
0 commit comments