From 74a4dbaa25052c05455834d06a4b1d99710b695c Mon Sep 17 00:00:00 2001 From: stefan <stefan@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Fri, 7 May 2010 15:19:33 +0000 Subject: [PATCH] Fixed bounds check for sequenceimpl git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2204 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/seq/base/src/impl/sequence_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/seq/base/src/impl/sequence_impl.cc b/modules/seq/base/src/impl/sequence_impl.cc index 5ce66685e..941d2c042 100644 --- a/modules/seq/base/src/impl/sequence_impl.cc +++ b/modules/seq/base/src/impl/sequence_impl.cc @@ -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 && end + amount > this->GetLength() || start + amount <= 0){ + if(start > end || start + amount <= 0 || end + amount > this->GetLength()){ throw std::out_of_range("Region not valid"); } String str1=seq_string_.substr(start, end-start); -- GitLab