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

[PATCH] Fwd: Off by one error in SetRevisionIndex

From: Tomas Kopal <Tomas.Kopal_at_altap.cz>
Date: 2007-06-25 11:35:17 CEST

It looks like my last attempt didn't get through, so once more:

-------- Original Message --------
Subject: Off by one error in SetRevisionIndex
Date: Thu, 21 Jun 2007 18:54:02 +0200
From: Tomas Kopal <Tomas.Kopal@altap.cz>
To: dev@subversion.tigris.org

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 11:37:06 2007

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

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