1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 17:59:04 +00:00

Updated targets to correctly check from errors in the addrset functions and call fatal

This commit is contained in:
colin
2011-06-20 21:57:58 +00:00
parent c1464a4213
commit e02b218925

View File

@@ -176,7 +176,9 @@ int load_exclude_file(addrset *excludelist, FILE *fp) {
while ((n = read_host_from_file(fp, host_spec, sizeof(host_spec))) > 0) { while ((n = read_host_from_file(fp, host_spec, sizeof(host_spec))) > 0) {
if (n >= sizeof(host_spec)) if (n >= sizeof(host_spec))
fatal("One of your exclude file specifications was too long to read (>= %u chars)", (unsigned int) sizeof(host_spec)); fatal("One of your exclude file specifications was too long to read (>= %u chars)", (unsigned int) sizeof(host_spec));
addrset_add_spec(excludelist, host_spec, o.af(), 1); if(!addrset_add_spec(excludelist, host_spec, o.af(), 1)){
fatal("Invalid address specification:");
}
} }
return 1; return 1;
@@ -186,7 +188,9 @@ int load_exclude_file(addrset *excludelist, FILE *fp) {
--exclude. */ --exclude. */
int load_exclude_string(addrset *excludelist, const char *s) { int load_exclude_string(addrset *excludelist, const char *s) {
addrset_init(excludelist); addrset_init(excludelist);
addrset_add_spec(excludelist, s, o.af(), 1); if (!addrset_add_spec(excludelist, s, o.af(), 1)){
fatal("Invalid address specification: %s", s);
}
return 1; return 1;
} }