The function `match_pattern()` is used to match conditionals in client configuration files or known hosts against the hostname the client is connecting to. When the configuration file or known_hosts file is controlled by the attacker, connecting to specific hostnames could cause timeouts and resource exhaustion due to the ineffective backtracking of complex regular expressions. The pattern matching was modified to avoid the needless backtracing.