Author: stefan2
Date: Wed Sep  8 09:58:07 2010
New Revision: 994956

URL: http://svn.apache.org/viewvc?rev=994956&view=rev
Log:
Fix server crashes reported by Johan Corvelyn.
As it turned out, find_entry used only the first 4 or 8 bytes
of the MD5 hash as a key to identify an entry.

* subversion/libsvn_subr/cache_membuffer.c
  (find_entry): compare & copy KEY_LEN bytes when dealing with keys.

Modified:
    subversion/branches/performance/subversion/libsvn_subr/cache-membuffer.c

Modified: 
subversion/branches/performance/subversion/libsvn_subr/cache-membuffer.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/cache-membuffer.c?rev=994956&r1=994955&r2=994956&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/cache-membuffer.c 
(original)
+++ subversion/branches/performance/subversion/libsvn_subr/cache-membuffer.c 
Wed Sep  8 09:58:07 2010
@@ -511,7 +511,7 @@ find_entry(svn_membuffer_t *cache,
    */
   for (i = 0; i < GROUP_SIZE; ++i)
     if (group[i].offset != NO_OFFSET && 
-        !memcmp(to_find, group[i].key, sizeof(to_find)))
+        !memcmp(to_find, group[i].key, KEY_SIZE))
       {
         /* found it
          */
@@ -556,7 +556,7 @@ find_entry(svn_membuffer_t *cache,
         }
 
       /* initialize entry for the new key */
-      memcpy(entry->key, to_find, sizeof(to_find));
+      memcpy(entry->key, to_find, KEY_SIZE);
     }
 
   return entry;


Reply via email to