Enhancement - Sequence range limiting
- Prevents overly large ranges. A bug was reported from a user
who tried this:
% task annotate 1 1-987654321
The 1-987654321 was assumed to be a valid range, and caused task
to consume all available memory. The workaround was:
% task 1 annotate 1-987654321
But it seems a good idea to range-limit sequences. Currently
it is 1000. Perhaps this should be configurable.
This commit is contained in:
@@ -83,8 +83,8 @@ void Sequence::parse (const std::string& input)
|
||||
if (low > high)
|
||||
throw std::string ("Inverted sequence range high-low");
|
||||
|
||||
if (high - low > 1000)
|
||||
throw std::string ("Range too large, exceeded 1,000 IDs");
|
||||
if (high - low >= SEQUENCE_MAX)
|
||||
throw std::string ("ID Range too large");
|
||||
|
||||
for (int i = low; i <= high; ++i)
|
||||
this->push_back (i);
|
||||
|
||||
Reference in New Issue
Block a user