Author: Diego Barrios Romero <[email protected]>
Date:   Wed Mar 14 20:15:48 2012 +0100

Corrected loop condition

As it was, it's possible that the received i is bigger than the number of
elements in vocab, therefore, trying to increment the iterator beyond its
limits and later trying to access a method of an inexistent element.

---

 synfig-core/src/synfig/valuenode.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/synfig-core/src/synfig/valuenode.cpp 
b/synfig-core/src/synfig/valuenode.cpp
index b3fd5c2..df260c7 100644
--- a/synfig-core/src/synfig/valuenode.cpp
+++ b/synfig-core/src/synfig/valuenode.cpp
@@ -686,7 +686,7 @@ LinkableValueNode::link_name(int i)const
        Vocab vocab(get_children_vocab());
        Vocab::iterator iter(vocab.begin());
        int j=0;
-       for(; iter!=vocab.end(), j<i; iter++, j++);
+       for(; iter!=vocab.end() && j<i; iter++, j++);
        return iter!=vocab.end()?iter->get_name():String();
 }
 
@@ -696,7 +696,7 @@ LinkableValueNode::link_local_name(int i)const
        Vocab vocab(get_children_vocab());
        Vocab::iterator iter(vocab.begin());
        int j=0;
-       for(; iter!=vocab.end(), j<i; iter++, j++);
+       for(; iter!=vocab.end() && j<i; iter++, j++);
        return iter!=vocab.end()?iter->get_local_name():String();
 }
 


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to