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

[PATCH][merge-tracking]data confusion(corruption?) when the source of merge has the merges from multiple other sources

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-11-01 20:49:28 CET

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

[[[

Data confusion(corruption?) while iterating over records.
This is visible if you have source of copy having merge from 2 different
merge sources.

* subversion/libsvn_fs_util/merge-info-sqlite-index.c
  (parse_mergeinfo_from_db):
   - Sqlite while looping through the records, reuses the same memory
     and hence causes data confusion while iterating.
     Just duplicate the data to our memory to avoid this confusion.
   - we set the *result with 'mergedfrom' as the key which should
     have been 'lastmergedfrom' or else mergeinfo would be incorrectly
     set for each paths.

Patch by: Kamesh Jayachandran <kamesh@collab.net>
]]]

Index: subversion/libsvn_fs_util/merge-info-sqlite-index.c
===================================================================
--- subversion/libsvn_fs_util/merge-info-sqlite-index.c (revision 22190)
+++ subversion/libsvn_fs_util/merge-info-sqlite-index.c (working copy)
@@ -326,9 +326,10 @@
           mergedfrom = (char *) sqlite3_column_text(stmt, 0);
           startrev = sqlite3_column_int64(stmt, 1);
           endrev = sqlite3_column_int64(stmt, 2);
+ mergedfrom = apr_pstrdup(pool, mergedfrom);
           if (lastmergedfrom && strcmp(mergedfrom, lastmergedfrom) != 0)
             {
- apr_hash_set(*result, mergedfrom, APR_HASH_KEY_STRING,
+ apr_hash_set(*result, lastmergedfrom, APR_HASH_KEY_STRING,
                            pathranges);
               pathranges = apr_array_make(pool, 1,
                                           sizeof(svn_merge_range_t *));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 1 20:50:15 2006

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.