[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Off by one error in SetRevisionIndex

From: Tomas Kopal <Tomas.Kopal_at_altap.cz>
Date: 2007-06-25 12:27:24 CEST

Hi all,
I started using TortoiseSVN recently, but it keeps crashing on me. So
grabbed the sources and went looking for problems. So, here is the first
one I found :-).

Index: RevisionIndex.cpp
===================================================================
--- RevisionIndex.cpp (revision 9818)
+++ RevisionIndex.cpp (working copy)
@@ -82,11 +82,11 @@
     else
     {
         revision_t size = (revision_t)indices.size();
- if (revision - firstRevision > size)
+ if (revision - firstRevision >= size)
         {
             // efficently grow on the upper end
 
- size_t toAdd = max (size, revision - firstRevision - size);
+ size_t toAdd = max (size, revision - firstRevision + 1 - size);
             indices.insert (indices.end(), toAdd, NO_INDEX);
         }
     }

Please, someone with more knowledge of the code, check the lower bound
growing too, I think it may suffer from the same problem.

Regards

Tomas

Received on Mon Jun 25 12:28:53 2007

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.