You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/02/04 10:31:41 UTC

svn commit: r1442053 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Author: stefan2
Date: Mon Feb  4 09:31:41 2013
New Revision: 1442053

URL: http://svn.apache.org/viewvc?rev=1442053&view=rev
Log:
Fix a membuffer cache bug introduced in 1.8:  Trying to make room
for the new contents of an existing key / item may remove the old
contents and, thus, the old index entry.  Before manually removing
the entry, we must check whether it still exists.

* subversion/libsvn_subr/cache-membuffer.c
  (membuffer_cache_set_internal): re-do entry lookup before removal

Modified:
    subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1442053&r1=1442052&r2=1442053&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Mon Feb  4 09:31:41 2013
@@ -1430,7 +1430,10 @@ membuffer_cache_set_internal(svn_membuff
   else
     {
       /* if there is already an entry for this key, drop it.
+       * Since ensure_data_insertable may have removed entries from
+       * ENTRY's group, re-do the lookup.
        */
+      entry = find_entry(cache, group_index, to_find, FALSE);
       if (entry)
         drop_entry(cache, entry);
     }