aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Uri.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp
index 56889b7..dbc9ff6 100644
--- a/src/Uri.cpp
+++ b/src/Uri.cpp
@@ -741,6 +741,15 @@ namespace Uri {
} break;
}
}
+ if (
+ (hostParsingState != HostParsingState::FIRST_CHARACTER)
+ && (hostParsingState != HostParsingState::NOT_IP_LITERAL)
+ && (hostParsingState != HostParsingState::GARBAGE_CHECK)
+ && (hostParsingState != HostParsingState::PORT)
+ ) {
+ // truncated or ended early
+ return false;
+ }
if (hostIsRegName) {
host = NormalizeCaseInsensitiveString(host);
}