http-form-fix for OSX and *BSD

This commit is contained in:
van Hauser 2014-12-10 10:01:24 +01:00
commit 61386fa275
2 changed files with 5 additions and 3 deletions

View file

@ -4,6 +4,7 @@ Changelog for hydra
Release 8.2-pre
* Added xhydra gtk patche by Petar Kaleychev to support modules that do not use usernames
* Better library finding in ./configure for SVN + support for Darwin Homebrew
* Fixed http-form module crash that only occurs on *BSD/OSX systems. Thanks to zdk for reporting!
* ... your patch?

View file

@ -974,8 +974,8 @@ int make_to_lower(char *buf) {
char *hydra_strrep(char *string, char *oldpiece, char *newpiece) {
int str_index, newstr_index, oldpiece_index, end, new_len, old_len, cpy_len;
char *c, oldstring[1024];
static char newstring[1024];
char *c, oldstring[1024], newstring[1024];
static char finalstring[1024];
if (string == NULL || oldpiece == NULL || newpiece == NULL || strlen(string) >= sizeof(oldstring) - 1
|| (strlen(string) + strlen(newpiece) - strlen(oldpiece) >= sizeof(newstring) - 1 && strlen(string) > strlen(oldpiece)))
@ -1011,7 +1011,8 @@ char *hydra_strrep(char *string, char *oldpiece, char *newpiece) {
strcpy(newstring + newstr_index, oldstring + str_index);
strcpy(oldstring, newstring);
// }
return newstring;
strcpy(finalstring, newstring);
return finalstring;
}
unsigned char hydra_conv64(unsigned char in) {