From b3bd06833480e3ae99102b6ff8e0fce867f4c308 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Wed, 6 Oct 2021 15:21:26 +0200 Subject: [PATCH] fix nits --- hydra-cisco.c | 2 +- hydra-vnc.c | 2 +- hydra.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hydra-cisco.c b/hydra-cisco.c index 72709ac..e31c749 100644 --- a/hydra-cisco.c +++ b/hydra-cisco.c @@ -5,7 +5,7 @@ #endif extern char *HYDRA_EXIT; -char *buf = NULL; +static char *buf = NULL; int32_t start_cisco(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) { char *empty = ""; diff --git a/hydra-vnc.c b/hydra-vnc.c index aeecd59..c836371 100644 --- a/hydra-vnc.c +++ b/hydra-vnc.c @@ -19,7 +19,7 @@ int32_t vnc_client_version = RFB33; int32_t failed_auth = 0; extern char *HYDRA_EXIT; -char *buf; +static char *buf; /* * Encrypt CHALLENGESIZE bytes in memory using a password. diff --git a/hydra.c b/hydra.c index 5ffecbe..7f37f11 100644 --- a/hydra.c +++ b/hydra.c @@ -2220,6 +2220,10 @@ int main(int argc, char *argv[]) { SERVICES = hydra_string_replace(SERVICES, "radmin2 ", ""); strcat(unsupported, "radmin2 "); #endif +#ifndef LIBFREERDP + SERVICES = hydra_string_replace(SERVICES, "rdp ", ""); + strcat(unsupported, "rdp "); +#endif #ifndef LIBSAPR3 SERVICES = hydra_string_replace(SERVICES, "sapr3 ", ""); strcat(unsupported, "sapr3 "); @@ -2267,11 +2271,6 @@ int main(int argc, char *argv[]) { strcat(unsupported, "SSL-services (ftps, sip, rdp, oracle-services, ...) "); #endif -#ifndef LIBFREERDP - // for rdp - SERVICES = hydra_string_replace(SERVICES, " rdp", ""); -#endif - #ifndef HAVE_MATH_H if (strlen(unsupported) > 0) strcat(unsupported, "and "); @@ -3940,9 +3939,10 @@ int main(int argc, char *argv[]) { } freeaddrinfo(res); } - // restore device information if present + // restore device information if present (overwrite null bytes) if (device != NULL) { - *(device - 1) = '%'; + char *tmpptr = device - 1; + *tmpptr = '%'; // you can ignore the compiler warning fprintf(stderr, "[WARNING] not all modules support BINDTODEVICE for IPv6 " "link local addresses, e.g. SSH does not\n"); }