I was just looking at the code for Node::insertChild.  While documenting 
how it works I noticed that the childIndex value is not checked to 
ensure it is in range.  As it stands, if you pass a childIndex > 
numChildren the iterator will run off the end of the list and could 
cause major problems.  In the case where childIndex == numChildren it 
should work as long as the mf vectors insert supports inserting at the 
end of the vector.

When we see issues like this (un-checked parameters) in the code, should 
we change the code to check the parameters, change it to assert for 
invalid parameters in debug builds, or just leave it as is?  (In this 
case I would vote for asserting in debug builds)

-Allen


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to