mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
cisco: use strstr only on non-null var (found by ccc-analyzer).
This commit is contained in:
parent
995c6d2385
commit
bb734b2c90
1 changed files with 5 additions and 4 deletions
|
@ -127,7 +127,7 @@ void service_cisco(char *ip, int32_t sp, unsigned char options, char *miscptr, F
|
|||
switch (run) {
|
||||
case 1: /* connect and service init function */
|
||||
{
|
||||
unsigned char *buf2;
|
||||
unsigned char *buf2 = NULL;
|
||||
int32_t f = 0;
|
||||
|
||||
if (sock >= 0)
|
||||
|
@ -151,9 +151,10 @@ void service_cisco(char *ip, int32_t sp, unsigned char options, char *miscptr, F
|
|||
hydra_child_exit(1);
|
||||
}
|
||||
do {
|
||||
if (f != 0)
|
||||
if (f != 0) {
|
||||
free(buf2);
|
||||
else
|
||||
buf2 = NULL;
|
||||
} else
|
||||
f = 1;
|
||||
if ((buf2 = (unsigned char *) hydra_receive_line(sock)) == NULL) {
|
||||
if (failc < retry) {
|
||||
|
@ -169,7 +170,7 @@ void service_cisco(char *ip, int32_t sp, unsigned char options, char *miscptr, F
|
|||
}
|
||||
if (buf2 != NULL && hydra_strcasestr((char*)buf2, "ress ENTER") != NULL)
|
||||
hydra_send(sock, "\r\n", 2, 0);
|
||||
} while (strstr((char *) buf2, "assw") == NULL);
|
||||
} while (buf2 != NULL && strstr((char *) buf2, "assw") == NULL);
|
||||
free(buf2);
|
||||
if (next_run != 0)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue