From cbd08d570275489b4b205c82878f835add924992 Mon Sep 17 00:00:00 2001 From: lhywk Date: Thu, 3 Jul 2025 05:07:27 +0000 Subject: [PATCH] Add NULL check after hydra_receive_line() in start_redis() --- hydra-redis.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hydra-redis.c b/hydra-redis.c index 179007c..5a81cec 100644 --- a/hydra-redis.c +++ b/hydra-redis.c @@ -24,6 +24,11 @@ int32_t start_redis(int32_t s, char *ip, int32_t port, unsigned char options, ch return 1; } buf = hydra_receive_line(s); + if (buf == NULL) { + hydra_report(stderr, "[ERROR] Failed to receive response from Redis server.\n"); + return 3; + } + if (buf[0] == '+') { hydra_report_found_host(port, ip, "redis", fp); hydra_completed_pair_found();