Fix size of pointer instead of size of data

This commit is contained in:
Diadlo 2017-04-17 22:41:12 +03:00
commit c760e7e5c5
No known key found for this signature in database
GPG key ID: 5AF9F2E29107C727
2 changed files with 4 additions and 4 deletions

View file

@ -65,7 +65,7 @@ int start_ncp(int s, char *ip, int port, unsigned char options, char *miscptr, F
}
memset(context, 0, sizeof(context));
strncpy(context, login, strlen(login));
strncpy(context + strlen(login), miscptr, sizeof(miscptr) + 1);
strncpy(context + strlen(login), miscptr, sizeof(char) + 1);
login = context;
}
}

View file

@ -3512,7 +3512,7 @@ int main(int argc, char *argv[]) {
exit(-1);
}
// if (countinfile > 60) fprintf(stderr, "[WARNING] the -M option is not working correctly at the moment for target lists > 60!\n");
hydra_targets = malloc(sizeof(hydra_targets) * (countservers + 2) + 8);
hydra_targets = malloc(sizeof(hydra_target*) * (countservers + 2) + 8);
if (hydra_targets == NULL)
bail("Could not allocate enough memory for target data");
sizeinfile = size_of_data;
@ -3600,7 +3600,7 @@ int main(int argc, char *argv[]) {
four_from = (addr4 & l);
l = 1 << (32 - k);
hydra_brains.targets = countservers = l;
hydra_targets = malloc(sizeof(hydra_targets) * (l + 2) + 8);
hydra_targets = malloc(sizeof(hydra_target*) * (l + 2) + 8);
if (hydra_targets == NULL)
bail("Could not allocate enough memory for target data");
i = 0;
@ -3864,7 +3864,7 @@ int main(int argc, char *argv[]) {
#endif
if (hydra_options.restore == 0) {
hydra_heads = malloc(sizeof(hydra_heads) * hydra_options.max_use);
hydra_heads = malloc(sizeof(hydra_head*) * hydra_options.max_use);
target_no = 0;
for (i = 0; i < hydra_options.max_use; i++) {
hydra_heads[i] = malloc(sizeof(hydra_head));