Fix string matching call for system without libpcre

hydra_string_match() function is only available if libpcre is present. Compilation crashes without that patch.
This commit is contained in:
David Maciejak 2019-08-30 10:44:09 +08:00 committed by GitHub
parent 150d325027
commit 5d25fa1d1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {