mirror of
https://github.com/nmap/nmap.git
synced 2025-12-23 16:09:02 +00:00
Check if the added target is too long. Currently we are using std::string objects to store new targets but we want to make sure that the script is not adding long strings.
This commit is contained in:
@@ -675,6 +675,10 @@ unsigned long NewTargets::insert (const char *target) {
|
|||||||
error("ERROR: adding targets is disabled in the Post-scanning phase.");
|
error("ERROR: adding targets is disabled in the Post-scanning phase.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (strlen(target) >= 1024) {
|
||||||
|
error("ERROR: new target is too long (>= 1024), failed to add it.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new_targets->push(target);
|
return new_targets->push(target);
|
||||||
|
|||||||
Reference in New Issue
Block a user