http-get bugfix

This commit is contained in:
van Hauser 2014-10-08 18:39:11 +02:00
parent 758f7f9e0b
commit eb1cd31030
2 changed files with 87 additions and 2 deletions

View file

@ -161,6 +161,8 @@ int start_http(int s, char *ip, int port, unsigned char options, char *miscptr,
if (tmpreplybuf[0] == 0 && strstr(http_buf, "HTTP/1.") != NULL) {
strncpy(tmpreplybuf, http_buf, sizeof(tmpreplybuf) - 1);
tmpreplybuf[sizeof(tmpreplybuf) - 1] = 0;
free(http_buf);
http_buf = hydra_receive_line(s);
} else if (tmpreplybuf[0] != 0) {
complete_line = 1;
if ((tmpreplybufptr = malloc(strlen(tmpreplybuf) + strlen(http_buf) + 1)) != NULL) {
@ -168,6 +170,7 @@ int start_http(int s, char *ip, int port, unsigned char options, char *miscptr,
strcat(tmpreplybufptr, http_buf);
free(http_buf);
http_buf = tmpreplybufptr;
if (debug) printf("http_buf now: %s\n", http_buf);
}
} else {
free(http_buf);