From 4ea062b1e324aa8444dec96f1614a1940a2430cf Mon Sep 17 00:00:00 2001 From: djalal Date: Sun, 3 Apr 2011 14:38:34 +0000 Subject: [PATCH] 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. --- TargetGroup.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TargetGroup.cc b/TargetGroup.cc index d4e54ab0b..94dda877a 100644 --- a/TargetGroup.cc +++ b/TargetGroup.cc @@ -675,6 +675,10 @@ unsigned long NewTargets::insert (const char *target) { error("ERROR: adding targets is disabled in the Post-scanning phase."); 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);