mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
Fix compilation warning
See below full log: hydra-http-proxy.c: In function ‘start_http_proxy’: hydra-http-proxy.c:26:26: warning: ‘%.200s’ directive writing up to 200 bytes into a region of size 24 [-Wformat-overflow=] sprintf(host, "Host: %.200s", ptr + 3); ^~~~~~ In file included from /usr/include/stdio.h:862:0, from hydra.h:3, from hydra-mod.h:4, from hydra-http-proxy.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 7 and 207 bytes into a destination of size 30 return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
e759b3768c
commit
edc01ed049
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ char *http_proxy_buf = NULL;
|
|||
int32_t start_http_proxy(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
char *empty = "";
|
||||
char *login, *pass, buffer[500], buffer2[500];
|
||||
char url[210], host[30];
|
||||
char url[210], host[60];
|
||||
char *header = ""; /* XXX TODO */
|
||||
char *ptr, *fooptr;
|
||||
|
||||
|
@ -23,7 +23,7 @@ int32_t start_http_proxy(int32_t s, char *ip, int32_t port, unsigned char option
|
|||
} else {
|
||||
sprintf(url, "%.200s", miscptr);
|
||||
ptr = strstr(miscptr, "://"); // :// check is in hydra.c
|
||||
sprintf(host, "Host: %.200s", ptr + 3);
|
||||
sprintf(host, "Host: %.50s", ptr + 3);
|
||||
if ((ptr = index(host, '/')) != NULL)
|
||||
*ptr = 0;
|
||||
if ((ptr = index(host + 6, ':')) != NULL && host[0] != '[')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue