Skip to content
Snippets Groups Projects
Commit a6b95b7e authored by stefan's avatar stefan
Browse files

Fixes for AlignedRegion and SequenceImpl (bounds check)

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2227 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 167fd613
Branches
Tags
No related merge requests found
......@@ -115,6 +115,9 @@ int AlignedRegion::GetMaster() const
void AlignedRegion::SetMaster(int master)
{
if(master < -1 || master >= aln_.GetCount()){
throw IntegrityError("Master out of bounds");
}
master_=master;
}
......
......@@ -280,7 +280,7 @@ void SequenceImpl::Replace(const String& str,int start, int end)
void SequenceImpl::ShiftRegion(int start, int end, int amount)
{
if(start > end || start + amount <= 0 || end + amount > this->GetLength()){
if(start > end || start + amount < 0 || end + amount > this->GetLength()){
throw std::out_of_range("ShiftRegion: invalid region");
}
String str1=seq_string_.substr(start, end-start);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment