1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Reverting r34420, uninitialized integer segfault

This commit is contained in:
dmiller
2015-04-17 18:59:06 +00:00
parent 1033287ccd
commit a25ea8806c

23
main.cc
View File

@@ -175,7 +175,6 @@ int main(int argc, char *argv[]) {
char *cptr; char *cptr;
int ret; int ret;
int i; int i;
int resume;
set_program_name(argv[0]); set_program_name(argv[0]);
@@ -217,22 +216,14 @@ int main(int argc, char *argv[]) {
return ret; return ret;
} }
/* Don't allow users to use --resume with other options */ if (argc == 3 && strcmp("--resume", argv[1]) == 0) {
for (i=0; i<argc; i++) { /* OK, they want to resume an aborted scan given the log file specified.
if ( strcmp("--resume", argv[i]) == 0) { Lets gather our state from the log file */
resume = 1; if (gather_logfile_resumption_state(argv[2], &myargc, &myargv) == -1) {
if(argc!=3) { fatal("Cannot resume from (supposed) log file %s", argv[2]);
fatal("Cannot use --resume with other options. Usage: nmap --resume <filename>");
}
if (gather_logfile_resumption_state(argv[i+1], &myargc, &myargv) == -1) {
fatal("Cannot resume from (supposed) log file %s", argv[i+1]);
}
} }
return nmap_main(myargc, myargv);
} }
if (resume == 1) { return nmap_main(argc, argv);
return nmap_main(myargc, myargv);
} else {
return nmap_main(argc, argv);
}
} }