1
0
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:
djalal
2011-04-03 14:38:34 +00:00
parent 0ee33e4cb7
commit 4ea062b1e3

View File

@@ -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);