diff --git a/hydra-mod.c b/hydra-mod.c index b675377..fd16e54 100644 --- a/hydra-mod.c +++ b/hydra-mod.c @@ -1043,15 +1043,15 @@ char *hydra_strrep(char *string, char *oldpiece, char *newpiece) { char *c, oldstring[6096], newstring[6096]; //updated due to issue 192 on github. static char finalstring[6096]; - if(strlen(string) > 6000) { - hydra_report(stderr, "[ERROR] Supplied URL or POST data too large. Max limit is 6000 characters.\n"); - exit(-1); - } - if (string == NULL || oldpiece == NULL || newpiece == NULL || strlen(string) >= sizeof(oldstring) - 1 || (strlen(string) + strlen(newpiece) - strlen(oldpiece) >= sizeof(newstring) - 1 && strlen(string) > strlen(oldpiece))) return NULL; + if (strlen(string) > 6000) { + hydra_report(stderr, "[ERROR] Supplied URL or POST data too large. Max limit is 6000 characters.\n"); + exit(-1); + } + strcpy(newstring, string); strcpy(oldstring, string); diff --git a/hydra-sip.c b/hydra-sip.c index 3faea0b..3cf3b33 100644 --- a/hydra-sip.c +++ b/hydra-sip.c @@ -32,7 +32,11 @@ void empty_register(char *buf, char *host, char *lhost, int port, int lport, cha "REGISTER sip:%s SIP/2.0\r\n" "Via: SIP/2.0/UDP %s:%i\r\n" "From: \r\n" - "To: \r\n" "Call-ID: 1337@%s\r\n" "CSeq: %i REGISTER\r\n" "Content-Length: 0\r\n\r\n", host, lhost, lport, user, host, user, host, host, cseq); + "To: \r\n" + "Call-ID: 1337@%s\r\n" + "CSeq: %i REGISTER\r\n" + "Content-Length: 0\r\n\r\n", + host, lhost, lport, user, host, user, host, host, cseq); } int get_sip_code(char *buf) { @@ -50,7 +54,7 @@ int start_sip(int s, char *ip, char *lip, int port, int lport, unsigned char opt char buf[SIP_MAX_BUF]; if (strlen(login = hydra_get_next_login()) == 0) - login = NULL; + return 3; if (strlen(pass = hydra_get_next_password()) == 0) pass = NULL; diff --git a/hydra-xmpp.c b/hydra-xmpp.c index 7fb4462..db38fe0 100644 --- a/hydra-xmpp.c +++ b/hydra-xmpp.c @@ -338,8 +338,7 @@ void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *m do { if ((buf = hydra_receive_line(sock)) == NULL) { /* no auth method identified */ - hydra_report(stderr, "[ERROR] no authentication methods can be identified %s\n", buf); - free(buf); + hydra_report(stderr, "[ERROR] no authentication methods can be identified\n"); hydra_child_exit(1); } diff --git a/hydra.c b/hydra.c index b3a81aa..d9f07e9 100644 --- a/hydra.c +++ b/hydra.c @@ -3173,7 +3173,7 @@ int main(int argc, char *argv[]) { cond = strtok(NULL, ":"); optional1 = strtok(NULL, "\n"); if ((variables == NULL) || (strstr(variables, "^USER^") == NULL && strstr(variables, "^PASS^") == NULL)) { - fprintf(stderr, "[ERROR] the variables argument needs at least the strings ^USER^ or ^PASS^: %s\n", variables); + fprintf(stderr, "[ERROR] the variables argument needs at least the strings ^USER^ or ^PASS^: %s\n", STR_NULL(variables)); exit(-1); } if ((url == NULL) || (cond == NULL)) {