From 99205f0410291c2fd63279288cafb0348e586ec7 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sun, 2 Jun 2019 11:11:30 +0800 Subject: [PATCH] Add length check for fixed-size string To prevent possible overflow. --- hydra-rdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra-rdp.c b/hydra-rdp.c index f2fbfce..c75e722 100644 --- a/hydra-rdp.c +++ b/hydra-rdp.c @@ -48,7 +48,7 @@ int32_t start_rdp(char *ip, int32_t port, unsigned char options, char *miscptr, if (strlen(pass = hydra_get_next_password()) == 0) pass = empty; - strcpy(server, hydra_address2string(ip)); + strncpy(server, hydra_address2string(ip), sizeof(server) - 1); if ((miscptr != NULL) && (strlen(miscptr) > 0)) { strncpy(domain, miscptr, sizeof(domain) - 1);