Re: [Crystal-cvs] SF.net SVN: crystal:[39210] CS/trunk/include/csutil/weakkeyedhash.h
Vincent Knecht <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <CAGsPR3i3WO7U25EJcF2xCOobiQ8Zi35f2BcjH+vC-P2qqSRdWA__31351.9189869568$1363899089$gmane$org@mail.gmail.com> |
2013/3/21 <[email protected]>: > Revision: 39210 > http://sourceforge.net/p/crystal/code/39210 > Author: res2002 > Date: 2013-03-21 17:23:13 +0000 (Thu, 21 Mar 2013) > Log Message: > ----------- > csutil/WeakKeyedHash: Fix out of bounds array access > > Modified Paths: > -------------- > CS/trunk/include/csutil/weakkeyedhash.h > > Modified: CS/trunk/include/csutil/weakkeyedhash.h > =================================================================== > --- CS/trunk/include/csutil/weakkeyedhash.h 2013-03-21 16:52:29 UTC (rev 39209) > +++ CS/trunk/include/csutil/weakkeyedhash.h 2013-03-21 17:23:13 UTC (rev 39210) > @@ -63,8 +63,7 @@ > if (this->Elements.GetSize() == 0) return fallback; > typename Superclass::ElementArray& values = > this->Elements[csHashComputer<K>::ComputeHash (key) % this->Modulo]; > - const size_t len = values.GetSize (); > - for (size_t i = 0; i < len; ++i) > + for (size_t i = 0; i < values.GetSize (); ++i) > { > const typename Superclass::Element& v = values[i]; > // Delete any elements with 'invalid' keys while searching Hello :-) I'm missing something (knowledge, I guess ;-) What's the difference ? How was the previous code wrong ? ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar