mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
Fix compilation warning
hydra-redis.c: In function ‘start_redis’: hydra-redis.c:18:51: warning: ‘%.250s’ directive writing up to 250 bytes into a region of size between 243 and 493 [-Wformat-overflow=] sprintf(buffer, "*2\r\n$4\r\nAUTH\r\n$%.250s\r\n%.250s\r\n", pass_num, pass); ^~~~~~ In file included from /usr/include/stdio.h:862:0, from hydra.h:3, from hydra-mod.h:4, from hydra-redis.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 20 and 520 bytes into a destination of size 510 return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
87e410e5a1
commit
e759b3768c
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ int32_t start_redis(int32_t s, char *ip, int32_t port, unsigned char options, ch
|
|||
snprintf(pass_num, 50, "%d", pass_len);
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
sprintf(buffer, "*2\r\n$4\r\nAUTH\r\n$%.250s\r\n%.250s\r\n", pass_num, pass);
|
||||
sprintf(buffer, "*2\r\n$4\r\nAUTH\r\n$%.50s\r\n%.250s\r\n", pass_num, pass);
|
||||
|
||||
if (debug)
|
||||
hydra_report(stderr, "[DEBUG] Auth:\n %s\n", buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue