From 5d25fa1d1c3fd64d17532316b1a2ea7c20983361 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Fri, 30 Aug 2019 10:44:09 +0800 Subject: [PATCH] Fix string matching call for system without libpcre hydra_string_match() function is only available if libpcre is present. Compilation crashes without that patch. --- hydra-http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hydra-http.c b/hydra-http.c index 1c12ff8..3a6b378 100644 --- a/hydra-http.c +++ b/hydra-http.c @@ -229,7 +229,11 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha if (ptr != NULL) ptr++; if (ptr != NULL && (*ptr == '2' || *ptr == '3' || strncmp(ptr, "403", 3) == 0 || strncmp(ptr, "404", 3) == 0)) { - if (end_condition_type>=0 && hydra_string_match(http_buf,end_condition)!=end_condition_type) { +#ifdef HAVE_PCRE + if (end_condition_type >= 0 && hydra_string_match(http_buf, end_condition)!=end_condition_type) { +#else + if (end_condition_type >= 0 && (strstr(http_buf, end_condition) == NULL ? 0 : 1) != end_condition_type) { +#endif if (debug) hydra_report(stderr, "End condition not match continue.\n"); hydra_completed_pair(); } else {