Skip to content

Commit

Permalink
Made regex for matching network addresses stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Jan 6, 2019
1 parent 93b4c60 commit 0e06f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/parse_network_address.cpp
Expand Up @@ -16,7 +16,7 @@

std::pair<std::string, std::string> parse_network_address(const std::string& address, const std::string& default_port)
{
const char* address_re = "\\[([[:xdigit:]:]*)\\](:(.*))?|([^:]*)(:([[:alnum:]]*))?";
const char* address_re = "\\[([[:xdigit:]:]*)\\](:([[:alnum:]]*))?|([[:alnum:]-_\\.]{1,253})(:([[:alnum:]]*))?";

std::smatch m;
std::regex_match(address, m, std::regex(address_re));
Expand Down

0 comments on commit 0e06f70

Please sign in to comment.