mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-14 10:37:27 -07:00
Merge pull request #44 from Uxio0/master
Fixed segfault checking command line arguments
This commit is contained in:
commit
dd4a042c52
1 changed files with 1 additions and 1 deletions
2
hydra.c
2
hydra.c
|
@ -2382,7 +2382,7 @@ int main(int argc, char *argv[]) {
|
|||
hydra_options.service = argv[optind];
|
||||
if (optind + 2 == argc)
|
||||
hydra_options.miscptr = argv[optind + 1];
|
||||
} else if (optind + 2 != argc && optind + 3 != argc) {
|
||||
} else if (optind + 2 != argc && optind + 3 != argc && optind < argc) {
|
||||
// check if targetdef follow syntax <service-name>://<target>[:<port-number>][/<parameters>] or it's a syntax error
|
||||
char *targetdef = strdup(argv[optind]);
|
||||
char *service_pos, *target_pos, *port_pos = NULL, *param_pos = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue