This commit is contained in:
David Maciejak 2019-03-20 10:45:59 +08:00
commit e57f97417d
3 changed files with 8 additions and 6 deletions

View file

@ -5,6 +5,7 @@ Release 8.9-dev
* your patch? :) * your patch? :)
* Fixed svn module memory leaks * Fixed svn module memory leaks
* Fixed rtsp module potential buffer overflow * Fixed rtsp module potential buffer overflow
* Fixed http module DIGEST-MD5 mode
* Added memcached module * Added memcached module
* Added mongodb module * Added mongodb module

View file

@ -13,7 +13,7 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
char *login, *pass, *buffer, buffer2[500]; char *login, *pass, *buffer, buffer2[500];
char *header; char *header;
char *ptr, *fooptr; char *ptr, *fooptr;
int32_t complete_line = 0; int32_t complete_line = 0, buffer_size;
char tmpreplybuf[1024] = "", *tmpreplybufptr; char tmpreplybuf[1024] = "", *tmpreplybufptr;
if (strlen(login = hydra_get_next_login()) == 0) if (strlen(login = hydra_get_next_login()) == 0)
@ -26,7 +26,8 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
header = stringify_headers(&ptr_head); header = stringify_headers(&ptr_head);
if(!(buffer = malloc(strlen(header) + 500))) { buffer_size = strlen(header) + 500;
if(!(buffer = malloc(buffer_size))) {
free(header); free(header);
return 3; return 3;
} }
@ -63,8 +64,8 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
char *pbuffer; char *pbuffer;
pbuffer = hydra_strcasestr(http_buf, "WWW-Authenticate: Digest "); pbuffer = hydra_strcasestr(http_buf, "WWW-Authenticate: Digest ");
strncpy(buffer, pbuffer + strlen("WWW-Authenticate: Digest "), sizeof(buffer)); strncpy(buffer, pbuffer + strlen("WWW-Authenticate: Digest "), buffer_size - 1);
buffer[sizeof(buffer) - 1] = '\0'; buffer[buffer_size - 1] = '\0';
fooptr = buffer2; fooptr = buffer2;
sasl_digest_md5(fooptr, login, pass, buffer, miscptr, type, webtarget, webport, header); sasl_digest_md5(fooptr, login, pass, buffer, miscptr, type, webtarget, webport, header);

View file

@ -4009,8 +4009,8 @@ int main(int argc, char *argv[]) {
error += j; error += j;
k = 0; k = 0;
for (j = 0; j < hydra_options.max_use; j++) for (i = 0; i < hydra_options.max_use; i++)
if (hydra_heads[j]->active == HEAD_ACTIVE) if (hydra_heads[i]->active == HEAD_ACTIVE)
k++; k++;
if (error == 0 && k == 0) { if (error == 0 && k == 0) {